本文整理汇总了Python中UIManager.UIManager.update方法的典型用法代码示例。如果您正苦于以下问题:Python UIManager.update方法的具体用法?Python UIManager.update怎么用?Python UIManager.update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIManager.UIManager
的用法示例。
在下文中一共展示了UIManager.update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GScript
# 需要导入模块: from UIManager import UIManager [as 别名]
# 或者: from UIManager.UIManager import update [as 别名]
#grooviksCube.QueueVictory();
startup = GScript();
startup.CreateRandom(30, .5);
startup.ForceQueue(grooviksCube);
while(True):
now = time.time();
if (now - timeStart > 2):
#print "Framerate"
#print cFrames / (now - timeStart)
cFrames = 0
timeStart = now
#sample the input
results = ui.update()
if results:
rotations = [];
for result in results:
command = result;
# if this is a rotation...
if (command < 18):
rot = command / 2
reverse = command % 2
rotations.append( [rot, reverse] )
print "queuing rotation";
if ( grooviksCube.QueueRotation( rotations ) ):
ui.broadcast('L');
locked = True;
#handle any display management
示例2: while
# 需要导入模块: from UIManager import UIManager [as 别名]
# 或者: from UIManager.UIManager import update [as 别名]
cFrames = 0;
timeStart = time.time();
iPixel = 0;
while(True):
now = time.time();
if (now - timeStart > 2):
print "Framerate";
print cFrames / (now - timeStart);
cFrames = 0;
timeStart = now;
#sample the input
result = ui.update();
if result:
command = result[0];
# if this is a rotation...
if (command < 18):
rot = command / 2;
reverse = command % 2;
print "queuing rotation";
#grooviksCube.QueueRotation( rot, reverse );
iPixel += 1;
if (iPixel == 54):
iPixel = 0;
#handle any display management
display.loop();