def __init__(self, marathon): """ Initialize the Marathon Screen """ PygameScreen.__init__(self) self.marathon = marathon self.backgroundImage = load_image(GetImagePath("Marathons/Kanto_Gym_Leaders.jpg")) self.congratsLabel = Label("Congratulations! You Won!") self.descriptionLabel = Label(marathon.description)
def buildIcon(self): """ Build and return the Icon Surface """ iconSurface = pygame.Surface((32, 32)) rawIconSurface = load_image(self.iconFilename) self.setTransparency(iconSurface, rawIconSurface) return iconSurface
def drawSurface(self): """ Draw the Widget """ self.drawOnSurface(self.tileImage, left=0, bottom=1) if self.tile.contents is not None: contentsImage = load_image( GetImagePath(self.tile.contents.getImageBaseName())) self.drawOnSurface(contentsImage, left=0, bottom=1)
def loadImage(self): """ Load the tile image """ if self.tile.tileFilename in self.filenameToImage: image = self.filenameToImage[self.tile.tileFilename] else: image = load_image(GetImagePath("Tiles/{0}.png".format(self.tile.tileFilename))) self.filenameToImage[self.tile.tileFilename] = image return image
def __init__(self, marathon): """ Initialize the Marathon Screen """ PygameScreen.__init__(self) self.marathon = marathon self.backgroundImage = load_image( GetImagePath("Marathons/Kanto_Gym_Leaders.jpg")) self.congratsLabel = Label("Congratulations! You Won!") self.descriptionLabel = Label(marathon.description)
def loadImage(self): """ Load the tile image """ if self.tile.tileFilename in self.filenameToImage: image = self.filenameToImage[self.tile.tileFilename] else: image = load_image( GetImagePath("Tiles/{0}.png".format(self.tile.tileFilename))) self.filenameToImage[self.tile.tileFilename] = image return image
def __init__(self, imageFilename, scaledSize=None): """ Initialize the Image by loading the Image File given """ self.image = load_image(imageFilename) if scaledSize is not None: self.image = pygame.transform.scale(self.image, scaledSize)
def drawSurface(self): """ Draw the Widget """ self.drawOnSurface(self.tileImage, left=0, bottom=1) if self.tile.contents is not None: contentsImage = load_image(GetImagePath(self.tile.contents.getImageBaseName())) self.drawOnSurface(contentsImage, left=0, bottom=1)
def setPokemonImage(self): """ Set the pokemon Image """ self.pokemonImage = load_image("{0}.png".format( self.getBasePokemonImageName()))
def setPokemonImage(self): """ Set the pokemon Image """ self.pokemonImage = load_image("{0}.png".format(self.getBasePokemonImageName()))