Example #1
0
 def __init__(self):
     """ Builds the scrolling map and starts it at the top left corner  """
     Image.__init__(self, GetImagePath("pokearth.png"))
     self.mapLoc = [0, 0]
     self.coord = [0, 0]
     
     self.xRange = range(1100-640)
     self.yRange = range(850-480)
Example #2
0
class MenuBackgroundWidget(SizedWidget):
    """ Represents the widget for a Menu Background """
    cornerImage = Image(GetImagePath("Menu/pokeball_corner.png"))

    def __init__(self, width, height):
        """ Initialize the widget """
        SizedWidget.__init__(self, width, height)
        self.background = GetTransparentSurface(width - 6, height - 6)
        self.background.fill((3, 60, 176, 127))
        self.horizontalBar = Surface((width - 6, 4))
        self.verticalBar = Surface((4, height - 6))

    def drawSurface(self):
        """ Draw the Widget """
        self.drawOnSurface(self.background,
                           left=(3.0 / self.width),
                           top=(3.0 / self.height))

        self.drawOnSurface(self.horizontalBar,
                           left=(3.0 / self.width),
                           top=(3.0 / self.height))
        self.drawOnSurface(self.horizontalBar,
                           left=(3.0 / self.width),
                           bottom=((self.height - 3.0) / self.height))

        self.drawOnSurface(self.verticalBar,
                           left=(3.0 / self.width),
                           top=(3.0 / self.height))
        self.drawOnSurface(self.verticalBar,
                           right=((self.width - 3.0) / self.width),
                           top=(3.0 / self.height))

        cornerImageSurface = self.cornerImage.draw()
        self.drawOnSurface(cornerImageSurface, left=0, top=0)
        self.drawOnSurface(cornerImageSurface, left=0, bottom=1)
        self.drawOnSurface(cornerImageSurface, right=1, top=0)
        self.drawOnSurface(cornerImageSurface, right=1, bottom=1)
Example #3
0
 def __init__(self, type):
     """ Initialize the widget """
     Image.__init__(self, GetImagePath("Types/{0}_type.png".format(type.lower())))
Example #4
0
 def __init__(self):
     """ Builds the logo """
     Image.__init__(self, GetImagePath("PkmnLogo.png"))
Example #5
0
 def __init__(self, type):
     """ Initialize the widget """
     Image.__init__(self,
                    GetImagePath("Types/{0}_type.png".format(type.lower())))
Example #6
0
 def __init__(self):
     """ Builds the logo """
     Image.__init__(self, GetImagePath("PkmnLogo.png"))