本文整理汇总了Python中status.Status.notify方法的典型用法代码示例。如果您正苦于以下问题:Python Status.notify方法的具体用法?Python Status.notify怎么用?Python Status.notify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类status.Status
的用法示例。
在下文中一共展示了Status.notify方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DisplayPanel
# 需要导入模块: from status import Status [as 别名]
# 或者: from status.Status import notify [as 别名]
class DisplayPanel(object):
def __init__(self, surface, pos, player, images):
self.surface = surface
self.pos = pos
self.player = player
self.images = images
self.optionsPos = (0,0)
self.optionsRect = pygame.Rect(self.optionsPos, (Cell.size * 12, Cell.size * 6))
self.options = Options(self.surface.subsurface(self.optionsRect), self.optionsPos, self.player, images)
self.statusPos = (0, Cell.size * 6 + Cell.size)
self.statusRect = pygame.Rect(self.statusPos, (Cell.size * 12, Cell.size))
self.status = Status(self.surface.subsurface(self.statusRect), self.statusPos, self.player, images)
self.logPos = (0, Cell.size * 7 + (Cell.size * 2))
self.logRect = pygame.Rect(self.logPos, (Cell.size * 12, Cell.size * 8))
self.log = Output(self.surface.subsurface(self.logRect), self.logPos, self.player.log)
def draw(self):
self.options.draw()
self.status.draw()
self.log.draw()
def notify(self, pos, event):
vec = Vector2(pos)
vec -= self.pos
point = (int(vec[0]), int(vec[1]))
if self.optionsRect.collidepoint(point):
self.options.notify(point, event)
if self.statusRect.collidepoint(point):
self.status.notify(point, event)
if self.logRect.collidepoint(point):
self.log.notify(point, event)