コード例 #1
0
 def __init__(self, x, y, title, width=400, height=200, colour=BROWN):
     self.colour = colour
     self.background = pygame.Surface((width, height))
     self.width = width
     self.height = height
     self.title = ClickableAsset(
         self._BORDER_PIXELS, self._BORDER_PIXELS,
         width - 2 * self._BORDER_PIXELS,
         self._TITLE_HEIGHT_PIXELS - self._BORDER_PIXELS, '')
     # HAX, f**k it, make go now
     self.title_background = ScaledImageAsset(0, 0, width,
                                              self._TITLE_HEIGHT_PIXELS,
                                              TITLE_BACKGROUND)
     self.title_text = CentredTextAsset(0,
                                        2,
                                        width,
                                        self._TITLE_HEIGHT_PIXELS,
                                        "== %s ==" % title,
                                        size=16,
                                        bold=True)
     self.body = ScaledImageAsset(0, self._TITLE_HEIGHT_PIXELS, width,
                                  height - self._TITLE_HEIGHT_PIXELS,
                                  BODY_BACKGROUND)
     self.title.offset_x = x
     self.title.offset_y = y
     self.assets = []
     PicassoAsset.__init__(self, None, x, y)