Tweak editor layout
authorNeil <neil@dip.sun.ac.za>
Tue, 16 Apr 2013 20:42:21 +0000 (22:42 +0200)
committerNeil <neil@dip.sun.ac.za>
Tue, 16 Apr 2013 20:42:21 +0000 (22:42 +0200)
erdslangetjie/editor/editor.py

index 08c5f6b32bf987a7a81a4c7946540a7624a949fa..553132e546e1c7bf981380375ca7efe60e809b8e 100644 (file)
@@ -14,10 +14,13 @@ from erdslangetjie.data import filepath, load
 from erdslangetjie.level import Level
 
 
+TILE_SIZE = 24
+
+
 class EditorWindow(FloatLayout):
 
     def __init__(self, level):
-        super(EditorWindow, self).__init__(size=(648, 480))
+        super(EditorWindow, self).__init__(size=(800, 600))
         if os.path.exists(filepath(level)):
             level_data = load(level)
             self.level = level
@@ -38,19 +41,18 @@ class EditorWindow(FloatLayout):
     def build(self):
         self.clear_widgets()
         tiles = self.level_obj.get_tiles()
-        tile_size = 24
         bx, by = 0, 0
         for tile_line in tiles:
             bx = 0
             for tile in tile_line:
-                node = Widget(size=(tile_size, tile_size), pos=(bx, by))
+                node = Widget(size=(TILE_SIZE, TILE_SIZE), pos=(bx, by))
                 with node.canvas:
                     Color(1, 1, 1)
                     Rectangle(pos=node.pos, size=node.size,
                             texture=tile.texture)
                 self.add_widget(node)
-                bx += tile_size
-            by += tile_size
+                bx += TILE_SIZE
+            by += TILE_SIZE
 
 
 class EditorApp(App):