import pygame.locals as pgl
from naja.constants import KEYS
+from naja.events import SceneChangeEvent
from naja.scenes.scene import Scene
from naja.widgets.text import TextWidget, TextBoxWidget
-from naja.events import SceneChangeEvent
class HowtoScene(Scene):
]), fontsize=32,
colour='white', padding=1, border=1,
bg_colour='black', border_colour='black',
- box_width=380, view_port=(780, 500)))
+ box_width=360, view_port=(780, 540)))
def handle_scene_event(self, ev):
from naja.scenes.menu import MenuScene
from naja.constants import FONT, FONT_SIZE, EIGHT_BIT_SCALE, PALETTE, KEYS
from naja.resources import resources
-from naja.resources.mutators import EIGHT_BIT, blender
+from naja.resources.mutators import EIGHT_BIT, R180, blender
from naja.utils import convert_colour
from naja.widgets.base import Widget
rect = self.pos
area = self.view_port
surface.blit(self.surface, rect, area)
+ if self.view_port is not None:
+ self.draw_arrows(surface)
+
+ def draw_arrows(self, surface):
+ if self.view_port.top > 0:
+ up = resources.get_image('bits', 'arrow_on.png',
+ transforms=(EIGHT_BIT,))
+ icon_size = up.get_rect().height
+ pos = (self.pos[0] + self.view_port.width - icon_size, self.pos[1])
+ surface.blit(up, pos)
+ if self.view_port.bottom < self.surface.get_rect().bottom:
+ down = resources.get_image('bits', 'arrow_on.png',
+ transforms=(R180, EIGHT_BIT))
+ icon_size = down.get_rect().height
+ pos = (self.pos[0] + self.view_port.width - icon_size,
+ self.pos[1] + self.view_port.height - icon_size)
+ surface.blit(down, pos)
class TextBoxWidget(TextWidget):