本文整理汇总了Python中Constants.getButtons方法的典型用法代码示例。如果您正苦于以下问题:Python Constants.getButtons方法的具体用法?Python Constants.getButtons怎么用?Python Constants.getButtons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constants
的用法示例。
在下文中一共展示了Constants.getButtons方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dispatch
# 需要导入模块: import Constants [as 别名]
# 或者: from Constants import getButtons [as 别名]
def dispatch(pos):
bTopLeft = Board.TOPLEFT
bWidth = Board.WIDTH
bBottom = bTopLeft + bWidth
if (bTopLeft <= pos[0] < bBottom) and (bTopLeft <= pos[1] < bBottom):
column = (pos[0]-bTopLeft)/60
row = (pos[1]-bTopLeft)/60
Board.selectTile(row,column)
else:
x = Constants.getButtons()
for i in x:
if i[0] == GameState.s.getGameState():
xmin = i[2]
ymin = i[3]
xmax = xmin + i[4]
ymax = ymin + i[5]
if (xmin<=pos[0]<=xmax) and (ymin<=pos[1] <=ymax):
callFunction(i[1])