Example #1
0
class Background(Element):
    '''The background element for the app, drawn behind all other "screen" elements.'''

    # APP
    def on_app(self):
        '''Called when this element is associated with an app. Initializes drawables.'''
        Element.on_app(Element)
        surface = pygame.Surface((500, 300))
        surface.fill((255, 255, 255))
        self.image = Sprite(app=self.app, surface=surface, x=0, y=0)

    # DRAW
    def draw(self, area):
        '''Draws this element's drawables within the specified area onto the App's display.'''
        self.image.draw(area)
Example #2
0
class Splash(Element):
    '''The main element of the Splash "screen," displays a logo image.'''

    # APP
    def on_app(self):
        '''Called when this element is associated with an App. Initializes drawables.'''
        self.image = Sprite(
            app=self.app,
            surface=pygame.image.load('res/img/splash.png').convert(),
            x=0,
            y=0)

    # DRAW
    def draw(self, area):
        '''Draws this element's drawables within the specified area onto the App's display.'''
        self.image.draw(area)
Example #3
0
class HelpSplash(Element):
    '''The main element of the Help "screen," displays images that serve as a tutorial for using the app.'''

    # APP
    def on_app(self):
        '''Called when this element is associated with an App. Initializes drawables.'''
        Element.on_app(self)
        self.image = Sprite(
            app=self.app,
            surface=pygame.image.load('res/img/help1.png').convert(),
            x=0,
            y=300)
        self.current = 1

    # DRAW
    def draw(self, area):
        '''Draws this element's drawables within the specified area onto the App's display.'''
        self.image.draw(area)