本文整理匯總了Python中GUI.reSort方法的典型用法代碼示例。如果您正苦於以下問題:Python GUI.reSort方法的具體用法?Python GUI.reSort怎麽用?Python GUI.reSort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GUI
的用法示例。
在下文中一共展示了GUI.reSort方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: handleMouseEnterEvent
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import reSort [as 別名]
def handleMouseEnterEvent(self, comp):
if self.gameStarted:
t = GUI.Text('YOU LOSE! Time: %.2f sec.' % (BigWorld.time() - self.gameStartTime))
t.colour = (255, 0, 0, 255)
t.position.z = 0.5
GUI.addRoot(t)
GUI.reSort()
BigWorld.callback(5, clear)
for root in GUI.roots():
if isinstance(root.script, _GameSquare):
root.script.gameStarted = False
return False
示例2: game
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import reSort [as 別名]
def game():
"""
Small game where the objective is to not touch the boxes
with the mouse for as long as possible :). Probably not
very challenging...
This will test mouse hit testing on moving components while and
hit testing while the mouse isn't being moved (i.e. you should be
able to lose the game when not moving the mouse).
"""
clear()
for i in range(10):
GUI.addRoot(_GameSquare.create().component)
t = GUI.Text('Get ready...')
t.colour = (255, 0, 0, 255)
t.position.z = 0.5
GUI.mcursor().clipped = True
GUI.addRoot(t)
BigWorld.callback(3, partial(_gameStarted, t))
GUI.reSort()
示例3: game
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import reSort [as 別名]
def game():
"""
Small game where the objective is to not touch the boxes
with the mouse for as long as possible :). Probably not
very challenging...
Note: Since hit testing in the GUI system is only ever done
when moving the mouse, the hit testing is a little flakey.
"""
clear()
for i in range(10):
GUI.addRoot( _GameSquare.create().component )
t = GUI.Text("Get ready...")
t.colour = (255,0,0,255)
t.position.z = 0.5
GUI.addRoot(t)
BigWorld.callback( 3, partial(_gameStarted, t) )
GUI.reSort()