本文整理汇总了Python中Console.input_clock方法的典型用法代码示例。如果您正苦于以下问题:Python Console.input_clock方法的具体用法?Python Console.input_clock怎么用?Python Console.input_clock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Console
的用法示例。
在下文中一共展示了Console.input_clock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: UI
# 需要导入模块: import Console [as 别名]
# 或者: from Console import input_clock [as 别名]
#.........这里部分代码省略.........
def load_2DUI(self,x):
if self._frozen == False:
self.surface.add2D(x)
self._2Dlist.append(x)
def unload_2DUI(self,x):
if self._frozen == False:
self.surface.rem2D(x)
self._2Dlist.remove(x)
def load_2Dtext(self,x):
if self._frozen == False:
self.surface.addtext(x)
self._textlist.append(x)
def unload_2Dtext(self,x):
if self._frozen == False:
self.surface.remtext(x)
self._textlist.remove(x)
def start(self,kernel):
pass
def stop(self,kernel):
self.console.shutdown()
pass
def pause(self,kernel):
pass
def resume(self,kernel):
pass
def run(self,kernel):
check_keyboard(self.keyboard)
self.refresh_fps()
self.console.input_clock()
pass
def name(self):
return "UI Process"
def switch_focus(self,target=""):
self.unload_2Dtext(self.current_text)
if target=="Engine":
self.input_handler = "Engine"
elif target=="Game":
self.input_handler = "Game"
elif target=="Console":
self.input_handler = "Console"
elif target!="":
pass
kernel.log.error("Unknown focus switch parameter: " + \
target)
elif self.input_handler == "Console":
self.input_handler = "Engine"
elif self.input_handler == "Engine":
self.input_handler = "Console"
else:
kernel.log.error("Warning - unsafe focus switch" + \
" operation not completed.")
pass
if self.input_handler=="Engine":
self.current_text = self.engine_text
self.load_2Dtext(self.current_text)
elif self.input_handler=="Console":
self.current_text= self.console_text
self.load_2Dtext(self.current_text)
elif self.game_text!= None:
self.current_text = self.game_text
self.load_2Dtext(self.current_text)
def add_fps(self):
self.fps = font.Text(self.f_header,global_render.fps,\
global_render.w.width-20,global_render.w.height-60,\
halign=font.Text.RIGHT,\
valign = font.Text.TOP,color = self.C_YELLOW)
self.load_2Dtext(self.fps)
def add_world_coords(self):
self.world_coords = font.Text(self.f_small,"",\
global_render.w.width-20,global_render.w.height-90,\
halign=font.Text.RIGHT,\
valign = font.Text.TOP,color = self.C_YELLOW)
self.load_2Dtext(self.world_coords)
def refresh_world_coords(self,x,y,z):
self.world_coords.text = "COORDS=("+str(x)+","+str(y)+","+str(z)+")"
def refresh_fps(self):
self.fps.text = "fps : %d" % (global_render.fps)
def testing(self):
self.text = font.Text(self.f_large,"Hammerfall Graphics Engine",\
global_render.w.width-20,global_render.w.height-20,halign = font.Text.RIGHT,\
valign = font.Text.TOP,color = (1,1,1,1))
global_render.addtext(self.text)
pass