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
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):