def __init__(self, entry, width, height): """ Initialize the widget """ MenuEntryWidget.__init__(self, entry, fontSize=28, width=width, height=height) self.entry = entry attack = self.entry.attack self.typeImage = TypeImage(attack.type) self.ppTextLabel = Label("PP", size=18) self.ppValuesLabel = Label("{0}/{1}".format(attack.currPowerPoints, attack.powerPoints), size=18)
def buildEntryViews(self, MenuEntryWidget=MenuEntryWidget): """ Build the Entry Views """ entries = [] widthPerEntry = self.width / self.columns heightPerEntry = self.height / self.rows for entry in self.menu.entries: entries.append( MenuEntryWidget(entry, widthPerEntry, heightPerEntry)) return entries
def __init__(self, width, height, pokemon=None, pokemonMenuEntry=None, showHP=True): """ Initialize the Pokemon Stats View """ if pokemon is not None: self.pokemon = pokemon pokemonMenuEntry = PokemonMenuEntry(self.pokemon, None) else: self.pokemon = pokemonMenuEntry.getPokemon() MenuEntryWidget.__init__(self, pokemonMenuEntry, width, height, fontSize=self.FONT_SIZE) self.showHP = showHP self.setLevelLabel() self.setHealthLabel() self.healthBarView = HealthBarView(self.pokemon, width, height * .1)
def __init__(self, menu): """ """ PygameScreen.__init__(self) self.menu = menu self.entries = [] for entry in self.menu.entries: self.entries.append( MenuEntryWidget(entry, width=self.width, height=self.height / float(len(self.menu.entries)))) self.selectedIndex = 0 self.buildMessageBox()
def update(self): """ Update the Pokemon Stats View """ MenuEntryWidget.update(self) self.setLevelLabel() self.setHealthLabel()