本文整理汇总了Python中theme.get_color函数的典型用法代码示例。如果您正苦于以下问题:Python get_color函数的具体用法?Python get_color怎么用?Python get_color使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_color函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: drawLives
def drawLives():
posx = (-stage.width / 2) + 3
for x in xrange(1, game.lives + 1):
posx += 1
drawTile(posx, (-stage.height / 2) - 1, theme.get_tile('lives'), theme.get_color('lives'))
posx += 1
drawTile(posx, (-stage.height / 2) - 1, theme.get_tile('border-h'), theme.get_color('border'))
开发者ID:alex5imon,项目名称:python-console-snake,代码行数:7,代码来源:graphics.py
示例2: drawInitGame
def drawInitGame():
drawTile(-5, -2, _(" Welcome to SNAKE "), theme.get_color('border'))
drawTile(-4, 2, _(" Press [ENTER] "), theme.get_color('border'))
left = u"\u2190"
up = u"\u2191"
down = u"\u2193"
right = u"\u2192"
drawTile(-5, 4, _(" Use [{0}{1}{2}{3}] to move ").format(left, up, down, right), theme.get_color('border'))
开发者ID:KanoComputing,项目名称:make-snake,代码行数:8,代码来源:graphics.py
示例3: drawInitGame
def drawInitGame():
drawTile(-5, -2, " Welcome to SNAKE ", theme.get_color('border'))
drawTile(-4, 2, " Press [ENTER] ", theme.get_color('border'))
left = u"\u2190"
up = u"\u2191"
down = u"\u2193"
right = u"\u2192"
drawTile(-5, 4, " Use [" + left + up + down + right + "] to move ", theme.get_color('border'))
开发者ID:alexaverill,项目名称:make-snake,代码行数:8,代码来源:graphics.py
示例4: drawBorders
def drawBorders():
for y in range(stage.boundaries['top'], stage.boundaries['bottom']):
drawTile(stage.boundaries['left'] - 1, y, theme.get_tile('border-v'), theme.get_color('border'))
drawTile(stage.boundaries['right'], y, theme.get_tile('border-v'), theme.get_color('border'))
for x in range(stage.boundaries['left'], stage.boundaries['right']):
drawTile(x, stage.boundaries['top'] - 1, theme.get_tile('border-h'), theme.get_color('border'))
drawTile(x, stage.boundaries['bottom'], theme.get_tile('border-h'), theme.get_color('border'))
drawTile(stage.boundaries['left'] - 1, stage.boundaries['top'] - 1, theme.get_tile('border-c'), theme.get_color('border'))
drawTile(stage.boundaries['left'] - 1, stage.boundaries['bottom'], theme.get_tile('border-c'), theme.get_color('border'))
drawTile(stage.boundaries['right'], stage.boundaries['top'] - 1, theme.get_tile('border-c'), theme.get_color('border'))
drawTile(stage.boundaries['right'], stage.boundaries['bottom'], theme.get_tile('border-c'), theme.get_color('border'))
开发者ID:alex5imon,项目名称:python-console-snake,代码行数:13,代码来源:graphics.py
示例5: drawSnake
def drawSnake():
for part in game.snake:
drawTile(
part[0],
part[1],
theme.get_tile('snake-body'),
theme.get_color('snake')
)
# Clean last tile
drawTile(
game.lastPos[0],
game.lastPos[1],
theme.get_tile('bg'),
theme.get_color('bg')
)
开发者ID:TomEelbode,项目名称:python-console-snake,代码行数:15,代码来源:graphics.py
示例6: drawScore
def drawScore():
score_formatted = str(game.score).zfill(2)
drawTile(
(stage.width / 2) - 1,
(-stage.height / 2) - 1,
score_formatted,
theme.get_color('border')
)
开发者ID:TomEelbode,项目名称:python-console-snake,代码行数:8,代码来源:graphics.py
示例7: drawApples
def drawApples():
for apple in game.apples:
drawTile(
apple[0],
apple[1],
theme.get_tile('apple'),
theme.get_color('apple')
)
开发者ID:TomEelbode,项目名称:python-console-snake,代码行数:8,代码来源:graphics.py
示例8: drawSnake
def drawSnake():
for part in game.snake:
drawTile(
part[0],
part[1],
theme.get_tile('snake-body'),
theme.get_color('snake')
)
开发者ID:KanoComputing,项目名称:make-snake,代码行数:8,代码来源:graphics.py
示例9: drawGameOver
def drawGameOver():
speed = gameloop.speed
size = stage.passSize
lives = game.lives
sizeStr = ''
speedStr = ''
livesStr = str(lives)
# set speed string
if(speed == .2):
speedStr = 'Slow'
elif(speed == .12):
speedStr = 'Medium'
elif(speed == .07):
speedStr = 'Fast'
# set size string
if(size == 's'):
sizeStr = 'Small'
elif(size == 'm'):
sizeStr = 'Medium'
elif(size == 'l'):
sizeStr = 'Large'
drawTile(-4, -10, " GAME OVER ", theme.get_color('border'))
drawTile(-3, -8, "Score:" + str(game.score), theme.get_color('border'))
drawTile(-3, -6, "Speed:" + speedStr, theme.get_color('border'))
drawTile(-3, -4, "Size:" + sizeStr, theme.get_color('border'))
drawTile(-3, -2, "Lives:" + livesStr, theme.get_color('border'))
if parser.args.tutorial:
drawTile(-6, 2, " Press [ENTER] to exit ", theme.get_color('border'))
else:
drawTile(-7, 2, " Press [ENTER] to continue ", theme.get_color('border'))
开发者ID:alexaverill,项目名称:make-snake,代码行数:31,代码来源:graphics.py
示例10: drawTile
def drawTile(x, y, tile='', color=None):
color = color or theme.get_color('default')
x = x * 2 + stage.padding[3] * 2 + stage.width / 2
y += stage.padding[0] + stage.height / 2
screen.addstr(y, x, tile, color)
if (len(tile) < 2):
screen.addstr(y, x + 1, tile, color)
开发者ID:TomEelbode,项目名称:python-console-snake,代码行数:9,代码来源:graphics.py
示例11: drawTile
def drawTile(x, y, tile='', color=None):
color = color or theme.get_color('default')
x = x * 2 + stage.padding[3] * 2 + stage.width / 2
y += stage.padding[0] + stage.height / 2
try:
screen.addstr(y, x, tile, color)
if (len(tile) < 2):
screen.addstr(y, x + 1, tile, color)
except:
# This is not the built-in exit, rather the one declared later on
exit()
开发者ID:alexaverill,项目名称:make-snake,代码行数:13,代码来源:graphics.py
示例12: drawHeader
def drawHeader():
header = []
header.append(".-------------------------------------------------------------.")
header.append("| .---._____ ______ ______ ______ _____ |")
header.append("| ( 8 ____ \___/ ____ \___/ ____ \___/ ____ \___/ ____`=- |")
header.append("| '---' \_____/ \_____/ \_____/ \_____/ |")
header.append("| ____ _ _____ _ _ _ |")
header.append("| / ___| _ __ __ _| | _____ | ____|__| (_) |_ ___ _ __ |")
header.append("| \___ \| '_ \ / _` | |/ / _ \ | _| / _` | | __/ _ \| '__| |")
header.append("| ___) | | | | (_| | < __/ | |__| (_| | | || (_) | | |")
header.append("| |____/|_| |_|\__,_|_|\_\___| |_____\__,_|_|\__\___/|_| |")
header.append("| |")
header.append("'-------------------------------------------------------------'")
x = (stage.width / 2) - 25
y = (-stage.height / 2) - 15
color = theme.get_color('menu')
for e in header:
drawTile(x, y, e, color)
y += 1
开发者ID:KanoComputing,项目名称:make-snake,代码行数:19,代码来源:graphics.py
示例13: drawBorders
def drawBorders():
tile_v = theme.get_tile('border-v')
tile_h = theme.get_tile('border-h')
tile_c = theme.get_tile('border-c')
color = theme.get_color('border')
x_left = stage.boundaries['left']
x_right = stage.boundaries['right']
y_top = stage.boundaries['top']
y_bottom = stage.boundaries['bottom']
for y in range(y_top, y_bottom):
drawTile(x_left - 1, y, tile_v, color)
drawTile(x_right, y, tile_v, color)
for x in range(x_left, x_right):
drawTile(x, y_top - 1, tile_h, color)
drawTile(x, y_bottom, tile_h, color)
drawTile(x_left - 1, y_top - 1, tile_c, color)
drawTile(x_left - 1, y_bottom, tile_c, color)
drawTile(x_right, y_top - 1, tile_c, color)
drawTile(x_right, y_bottom, tile_c, color)
开发者ID:TomEelbode,项目名称:python-console-snake,代码行数:24,代码来源:graphics.py
示例14: drawGame
def drawGame():
for y in range(stage.boundaries['top'], stage.boundaries['bottom']):
for x in range(stage.boundaries['left'], stage.boundaries['right']):
drawTile(x, y, theme.get_tile('bg'), theme.get_color('bg'))
drawBorders()
drawText()
开发者ID:TomEelbode,项目名称:python-console-snake,代码行数:6,代码来源:graphics.py
示例15: drawText
def drawText():
color = theme.get_color('border')
score_text = _("score:")
drawTile((stage.width / 2) - (len(score_text) / 2) - 2, (-stage.height / 2) - 1, score_text, color)
drawTile((-stage.width / 2), (-stage.height / 2) - 1, _("lives:"), color)
drawTile(-5, (stage.height / 2), _(" Press Q to quit "), color)
开发者ID:KanoComputing,项目名称:make-snake,代码行数:6,代码来源:graphics.py
示例16: drawCurrentMenu
def drawCurrentMenu():
# Clean tiles
for x in xrange(TitleXPos, -1 * TitleXPos):
for y in xrange(menuYPos, 25):
drawTile(x, y, ' ', theme.get_color('menu'))
x = menuXPos
idx = 0
# Draw Menu
# Title
y = menuYPos - menuYInc
auxX = TitleXPos
for e in controls.get_menu_title():
drawTile(TitleXPos, y, e, theme.get_color('menu'))
if e != '' and e != '.Board' and e != '.Elements':
drawTile(auxX, y - 1, "| ", theme.get_color('menu'))
auxX += 1
y += menuYInc
y = menuYPos
# Options
for string in controls.currentMenu:
# Color menu
if controls.currentMenu == menus.colors:
color = menus.colors[idx][0]
if controls.currentIdx == idx:
head = '> ['
else:
head = ' ['
text = ' ] ' + _(string[0])
drawTile(x, y, text, theme.get_color('menu'))
drawTile(x, y, ' ', theme.get_color(color))
drawTile(x, y, head, theme.get_color('menu'))
# Symbol menu
elif controls.symbolMode:
if controls.currentIdx == idx:
text = '> ' + string[0]
if len(controls.tile) > 0:
text += ' : ' + controls.tile[0]
if len(controls.tile) > 1:
text += ' ' + controls.tile[1]
text += ' >> ' + _('Press [ENTER]')
else:
text += ' _'
else:
text += ' : _ _'
else:
text = ' ' + string[0]
drawTile(x, y, text, theme.get_color('menu'))
# Naming mode
elif controls.nameMode:
if controls.currentIdx == idx:
text = '> ' + string[0]
if len(controls.tile) > 0:
text += ' : ' + controls.tile
else:
text += ' : '
else:
text = ' ' + string[0]
drawTile(x, y, text, theme.get_color('menu'))
# Rest
else:
if controls.currentIdx == idx:
text = '> ' + string[0]
else:
text = ' ' + string[0]
# Exception: show delete in red if theme is custom-theme
if string[0] == _('Delete Theme') and controls.theme_name == os.path.splitext(theme.CUSTOM_THEME)[0]:
colour = theme.get_color('Red')
else:
colour = theme.get_color('menu')
drawTile(x, y, text, colour)
y += menuYInc
idx += 1
开发者ID:KanoComputing,项目名称:make-snake,代码行数:72,代码来源:graphics.py
示例17: drawGameOver
def drawGameOver():
drawTile(-4, -1, " GAME OVER ", theme.get_color('border'))
drawTile(-7, 1, " Press ENTER to restart ", theme.get_color('border'))
开发者ID:TomEelbode,项目名称:python-console-snake,代码行数:3,代码来源:graphics.py
示例18: drawText
def drawText():
color = theme.get_color('border')
drawTile((stage.width / 2) - 4, (-stage.height / 2) - 1, "score:", color)
drawTile((-stage.width / 2), (-stage.height / 2) - 1, "lives:", color)
drawTile(-5, (stage.height / 2), " Press Q to quit ", color)
开发者ID:TomEelbode,项目名称:python-console-snake,代码行数:5,代码来源:graphics.py
注:本文中的theme.get_color函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论