本文整理汇总了Python中Matrix.matrixToSet方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.matrixToSet方法的具体用法?Python Matrix.matrixToSet怎么用?Python Matrix.matrixToSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix
的用法示例。
在下文中一共展示了Matrix.matrixToSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Matrix [as 别名]
# 或者: from Matrix import matrixToSet [as 别名]
def __init__(self, **kwargs):
super(MainMenu, self).__init__(
"MainMenu", onHeaderClick=lambda: Webbrowser.open(PROJECT_SITE),
header_font=MENU_HEADER_FONT, option_font=MENU_OPTION_FONT, isroot=True, xcenter=True,
soundtrack=Path.join(Load.MUSICDIR, "jazz_cat_infinite_loop_cut.ogg"), sound_enabled=SOUND_ENABLED, **kwargs)
self.title_blocks = BlockText.render(TITLE_TEXT, font=Load.loadBlockFont("standard"))
blockwidth = (self.width) // len(self.title_blocks[0])
Log.debug("title_board.blockwidth = {}".format(blockwidth))
self.addJob("title_board",
Jobs.Board(
self,
y=SPACER,
height=len(self.title_blocks),
width=len(self.title_blocks[0]),
blockwidth=blockwidth,
bgcolor=self.bgcolor,
queue=100,
draw_grid=False,
draw_border=False,
)
)
self.jobs.title_board.x = (self.width // 2) - (self.jobs.title_board.width // 2)
for x, y in Matrix.matrixToSet(self.title_blocks):
self.jobs.title_board.blocks[(x, y)] = (0xaa,0xaa,0xaa)
self.options_pos[1] = self.jobs.title_board.y + self.jobs.title_board.height + SPACER*2
self.menu = Factory.textBoxes([
("Single Player", lambda: self.call(TetrisGame.TetrisGame, caption="Loltris")),
("Two Player", lambda: self.call(TwoPlayerTetrisGame.TwoPlayerTetris, caption="Loltris - Two Player")),
("LAN Play", lambda: self.call(LANTetrisGame.LANMenu, caption="Loltris - LAN play")),
("Options", lambda: self.call(OptionsMenu, caption="Loltris - Options")),
("Creative", lambda: self.call(MakeTetromino.MakeTetromino, caption="Loltris - Creator")),
("Scores", lambda: self.call(HighscoreExplorer.HighscoreList, caption="Loltris - Highscores")),
("Credits", lambda: self.call(Credits.Credits, caption="Loltris - Credits")),
("Homepage", lambda: Webbrowser.open(PROJECT_SITE)),
("SandBox", lambda: self.call(SandBox.SandBox, caption="Loltris - SandBox")),
("Exit", self.quit),
],
self,
font=MENU_OPTION_FONT,
fill=MENU_3DBORDER_BACKGROUND,
xcenter=True,
colors={
"background":self.colorscheme["background"],
"font":self.colorscheme["option"],
},
)
self.setupObjects()
#self.loadHighscores()
## XXX: Temporary bugfix, scroll_filler is drawn on every frame while the board is not.
del self.jobs.scroll_filler