Example #1
0
 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)
Example #2
0
 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
Example #3
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 #4
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 #5
0
 def make_box(self):
     '''Called when this text entry box is associated with an App, creates the box drawable'''
     self.box = Sprite(
         app=self.app,
         surface=pygame.image.load('res/img/box_400px.png').convert(),
         x=50,
         y=460)
Example #6
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)
Example #7
0
 def on_app(self):
     '''Called when this element is associated with an App. Initializes drawables.'''
     Button.on_app(self)
     self.box = Sprite(app=self.app,
                       surface=pygame.image.load(
                           'res/img/button_75px_gray.png').convert(),
                       x=415,
                       y=560)
     self.label = Label(app=self.app,
                        font=pygame.font.Font('res/font/Oswald-Regular.ttf',
                                              16),
                        text='Next',
                        x=415,
                        y=560,
                        color=COLOR.WHITE,
                        center_x=75)
Example #8
0
 def on_app(self):
     '''Called when this element is associated with an App. Initializes drawables.'''
     Button.on_app(self)
     self.box = Sprite(app=self.app,
                       surface=pygame.image.load(
                           'res/img/button_150px_red.png').convert(),
                       x=300,
                       y=230)
     self.label = Label(app=self.app,
                        font=pygame.font.Font('res/font/Oswald-Regular.ttf',
                                              42),
                        text='Start',
                        x=300,
                        y=230,
                        color=COLOR.WHITE,
                        center_x=150,
                        center_y=60)
Example #9
0
 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)