Esempio n. 1
0
    def render(self):
        if self.predraw != None:
            self.predraw( self.screen )

        pygwrap.draw_border( self.screen , self )
        self.screen.set_clip(self)

        item_num = self.top_item
        y = self.top
        while y < self.bottom:
            if item_num < len( self.items ):
                # The color of this item depends on whether or not it's the selected one.
                if item_num == self.selected_item:
                    color = self.menuselect
                else:
                    color = self.menuitem
                img = MENUFONT.render(self.items[item_num].msg, True, color )
                self.screen.blit( img , ( self.left , y ) )
                y += MENUFONT.get_linesize()
            else:
                break
            item_num += 1

        self.screen.set_clip(None)

        if self.descbox != None:
            self.descbox.render()
Esempio n. 2
0
 def __call__( self , screen ):
     if self.levelmap != None:
         self.levelmap.render( screen , show_special = True )
     else:
         self.backdrop.tile( screen , ( self.counter * 5 , self.counter ) )
     pygwrap.draw_border( screen , self.rect )
     pygwrap.draw_text( screen , rpgmenu.MENUFONT , self.caption , self.rect , do_center = True )
     self.counter += 5
Esempio n. 3
0
 def render(self):
     pygwrap.draw_border( self.menu.screen , self )
     if self.menu.items[self.menu.selected_item].desc != None:
         img = pygwrap.render_text( MENUFONT , self.menu.items[self.menu.selected_item].desc , self.w )
         self.menu.screen.blit( img , self )