本文整理匯總了Python中status.Status.draw方法的典型用法代碼示例。如果您正苦於以下問題:Python Status.draw方法的具體用法?Python Status.draw怎麽用?Python Status.draw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類status.Status
的用法示例。
在下文中一共展示了Status.draw方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DisplayPanel
# 需要導入模塊: from status import Status [as 別名]
# 或者: from status.Status import draw [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)