Ejemplo n.º 1
0
class BattleMessageBox(SizedWidget):
    """ Represents the Message Box for a Battle """

    def __init__(self, battle, width, height):
        """ Initialize the Battle Message Box """
        SizedWidget.__init__(self, width, height)
        self.messageBox = MessageBox("")
        self.battle = battle

    def update(self):
        """ Update the screen """
        if not self.battle.noEvents() and not self.battle.eventQueue[0] == self.messageBox.message:
            self.messageBox = MessageBox(self.battle.eventQueue[0])
        self.messageBox.update()

    def drawSurface(self):
        """ Draw the child Message Box """
        messageBoxSurface = self.messageBox.draw()
        self.drawOnSurface(messageBoxSurface, centerx=0.5, centery=0.5)
Ejemplo n.º 2
0
class BattleMessageBox(SizedWidget):
    """ Represents the Message Box for a Battle """
    def __init__(self, battle, width, height):
        """ Initialize the Battle Message Box """
        SizedWidget.__init__(self, width, height)
        self.messageBox = MessageBox("")
        self.battle = battle

    def update(self):
        """ Update the screen """
        if not self.battle.noEvents(
        ) and not self.battle.eventQueue[0] == self.messageBox.message:
            self.messageBox = MessageBox(self.battle.eventQueue[0])
        self.messageBox.update()

    def drawSurface(self):
        """ Draw the child Message Box """
        messageBoxSurface = self.messageBox.draw()
        self.drawOnSurface(messageBoxSurface, centerx=.5, centery=.5)
Ejemplo n.º 3
0
class MessageBoxScreen(PygameScreen):
    """ Represents a message box screen """
    def __init__(self, message, lastScreen):
        """ Initialize the Message Box Screen """
        PygameScreen.__init__(self)
        self.messageBox = MessageBox(self.width * .9, self.height * .3,
                                     message)
        self.lastScreen = lastScreen

    def drawSurface(self):
        """ Draw the Screen """
        previousScreenSurface = self.lastScreen.draw()
        self.drawOnSurface(previousScreenSurface, left=0, top=0)

        messageBoxSurface = self.messageBox.draw()
        self.drawOnSurface(messageBoxSurface, left=.05, top=.7)

    def update(self):
        """ Update the Screen """
        self.lastScreen.update()
        self.messageBox.update()
Ejemplo n.º 4
0
class MessageBoxScreen(PygameScreen):
    """ Represents a message box screen """
    
    def __init__(self, message, lastScreen):
        """ Initialize the Message Box Screen """
        PygameScreen.__init__(self)
        self.messageBox = MessageBox(self.width*.9, self.height*.3, message)
        self.lastScreen = lastScreen
        
    def drawSurface(self):
        """ Draw the Screen """
        previousScreenSurface = self.lastScreen.draw()
        self.drawOnSurface(previousScreenSurface, left=0, top=0)
        
        messageBoxSurface = self.messageBox.draw()
        self.drawOnSurface(messageBoxSurface, left=.05, top=.7)
        
    def update(self):
        """ Update the Screen """
        self.lastScreen.update()
        self.messageBox.update()
Ejemplo n.º 5
0
 def buildMessageBox(self):
     """ Builds a Message Box """
     battleMessage = BattleMessage("{0}'s first Pkmn is {1}".format(
         self.entries[self.selectedIndex].entry.trainer.name, self.entries[
             self.selectedIndex].entry.trainer.beltPokemon[0].name))
     self.messageBox = MessageBox(battleMessage)
Ejemplo n.º 6
0
 def __init__(self, message, lastScreen):
     """ Initialize the Message Box Screen """
     PygameScreen.__init__(self)
     self.messageBox = MessageBox(self.width * .9, self.height * .3,
                                  message)
     self.lastScreen = lastScreen
Ejemplo n.º 7
0
 def __init__(self, battle, width, height):
     """ Initialize the Battle Message Box """
     SizedWidget.__init__(self, width, height)
     self.messageBox = MessageBox("")
     self.battle = battle
Ejemplo n.º 8
0
 def update(self):
     """ Update the screen """
     if not self.battle.noEvents(
     ) and not self.battle.eventQueue[0] == self.messageBox.message:
         self.messageBox = MessageBox(self.battle.eventQueue[0])
     self.messageBox.update()
Ejemplo n.º 9
0
 def __init__(self, battle, width, height):
     """ Initialize the Battle Message Box """
     SizedWidget.__init__(self, width, height)
     self.messageBox = MessageBox("")
     self.battle = battle
Ejemplo n.º 10
0
 def update(self):
     """ Update the screen """
     if not self.battle.noEvents() and not self.battle.eventQueue[0] == self.messageBox.message:
         self.messageBox = MessageBox(self.battle.eventQueue[0])
     self.messageBox.update()
Ejemplo n.º 11
0
 def __init__(self, message, lastScreen):
     """ Initialize the Message Box Screen """
     PygameScreen.__init__(self)
     self.messageBox = MessageBox(self.width*.9, self.height*.3, message)
     self.lastScreen = lastScreen