本文整理汇总了Python中myrmidon.Game.mouse方法的典型用法代码示例。如果您正苦于以下问题:Python Game.mouse方法的具体用法?Python Game.mouse怎么用?Python Game.mouse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myrmidon.Game
的用法示例。
在下文中一共展示了Game.mouse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import mouse [as 别名]
def _update(self):
if Game.mouse().wheel_up:
self.text.text = "UP"
elif Game.mouse().wheel_down:
self.text.text = "DOWN"
else:
self.text.text = ""
示例2: state_grabbed
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import mouse [as 别名]
def state_grabbed(self):
while True:
self.x = Game.mouse().x#rel[0]
self.y = Game.mouse().y#rel[1]
self.check_snapping()
if Game.mouse().left_up:
self.app.hover_block = None
self.app.grab_block = None
yield self.switch_state("state_normal")
yield
示例3: state_hover
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import mouse [as 别名]
def state_hover(self):
while True:
self.alpha = 0.9
if not self.collide_with(Game.mouse()).result:
self.app.hover_block = None
yield self.switch_state("state_normal")
if Game.mouse().left_down:
self.app.grab_block = self
yield self.switch_state("state_grabbed")
yield
示例4: state_normal
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import mouse [as 别名]
def state_normal(self):
while True:
self.alpha = 1.0
if self.collide_with(Game.mouse()).result:
if not self.app.hover_block:
self.app.hover_block = self
yield self.switch_state("state_hover")
yield
示例5: execute
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import mouse [as 别名]
def execute(self, window):
self.window = window
self.image = self.window.test_image
self.x, self.y = 0, 0
#self.colour = (1.0, 0.0, 0.0)
#self.alpha = 0.5
while True:
self.x, self.y = Game.mouse().pos
#self.rotation -= 1
#self.scale += 0.005
yield