当前位置: 首页>>代码示例>>Python>>正文


Python UIManager.update方法代码示例

本文整理汇总了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 
开发者ID:mtyka,项目名称:grooviks-cube,代码行数:33,代码来源:groovik_playa.py

示例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();
      
开发者ID:mtyka,项目名称:grooviks-cube,代码行数:31,代码来源:groovik_playa_setup.py


注:本文中的UIManager.UIManager.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。