From 8610f02a99de7e6ac77099b2f6f832ed8b429afe Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 16 Apr 2013 22:42:21 +0200 Subject: [PATCH] Tweak editor layout --- erdslangetjie/editor/editor.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/erdslangetjie/editor/editor.py b/erdslangetjie/editor/editor.py index 08c5f6b..553132e 100644 --- a/erdslangetjie/editor/editor.py +++ b/erdslangetjie/editor/editor.py @@ -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): -- 2.34.1