Allow shift location action to move the whole row.
[naja.git] / naja / scenes / introduction.py
index 95defaa76d6837e3c9b359c7829d0db2ac0efbff..a8e001fdf47bf2d17ca298304e82436ce15d898b 100644 (file)
@@ -3,8 +3,9 @@ Load and save scenes.
 """
 
 import pygame.locals as pgl
 """
 
 import pygame.locals as pgl
+import pygame
 
 
-from naja.constants import KEYS
+from naja.constants import KEYS, SCREEN
 from naja.events import SceneChangeEvent, LoadGameEvent
 from naja.gamestate import GameState
 from naja.scenes.scene import Scene
 from naja.events import SceneChangeEvent, LoadGameEvent
 from naja.gamestate import GameState
 from naja.scenes.scene import Scene
@@ -12,7 +13,10 @@ from naja.scenes.howto import HowtoScene
 from naja.widgets.image_box import ImageBox
 from naja.widgets.selector import SelectorWidget
 from naja.widgets.text import TextWidget
 from naja.widgets.image_box import ImageBox
 from naja.widgets.selector import SelectorWidget
 from naja.widgets.text import TextWidget
-
+from naja.widgets.text import TextBoxWidget
+from naja.resources import resources
+from naja.scenes.dummygame import DummyGameScene
+from naja.widgets.image_box import PreRenderedImageBox
 
 class IntroductionScene(Scene):
     def __init__(self, state):
 
 class IntroductionScene(Scene):
     def __init__(self, state):
@@ -61,6 +65,25 @@ class IntroductionScene(Scene):
         LoadGameEvent.post(state=GameState.new(deck='introduction'))
         SceneChangeEvent.post(GameScene)
 
         LoadGameEvent.post(state=GameState.new(deck='introduction'))
         SceneChangeEvent.post(GameScene)
 
+    def introduction_to_screen_1(self, event):
+        self.container.widgets = []
+        state = resources.get_json('tutorial/tutorial_screen_1.json')
+        dummy_game = DummyGameScene(state)
+        game_surface = pygame.surface.Surface(SCREEN)
+        dummy_game.render(game_surface)
+        self.add(PreRenderedImageBox((0, 0), game_surface))
+
+        self.add(TextBoxWidget(
+            (10, 50), '\n'.join([
+                "You are a robot, frantically trying to set the correct "
+                "bits to gain points for reasons that are unlikely ever "
+                "to become clear.",
+            ]), fontsize=32,
+            colour='white', padding=1, border=1,
+            bg_colour='black', border_colour='black',
+            box_width=740, view_port=(780, 540)))
+
+
     def handle_scene_event(self, ev):
         if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
             from naja.scenes.menu import MenuScene
     def handle_scene_event(self, ev):
         if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT:
             from naja.scenes.menu import MenuScene