@@ -67,10 +67,8 @@ def gui_generateTilePositions( | |||||
ps = [] | ps = [] | ||||
for i in range(0, len(positions)): | for i in range(0, len(positions)): | ||||
p = positions[i] | |||||
x = p[0] * c.cellSize | |||||
y = c.windowHeight - p[1] * c.cellSize | |||||
ps.append([x, y]) | |||||
p = gui_aux_cellScreenPosition(c, positions[i]) | |||||
ps.append(p) | |||||
#} | #} | ||||
c.tilePositions = ps | c.tilePositions = ps | ||||
@@ -1,3 +1,4 @@ | |||||
from memory_Context import * | |||||
# Generate positions in cell dimensions | # Generate positions in cell dimensions | ||||
# | # | ||||
@@ -44,3 +45,13 @@ def gui_aux_cellPositions( | |||||
] | ] | ||||
#} | #} | ||||
#} | #} | ||||
# Convert cell position to screen position | |||||
def gui_aux_cellScreenPosition( | |||||
c: memory_Context, | |||||
pos: [int] | |||||
) -> [int]: | |||||
x = pos[0] * c.cellSize | |||||
y = c.windowHeight - pos[1] * c.cellSize | |||||
return [x, y] | |||||
#} |
@@ -108,6 +108,11 @@ ctrl.set("tileImage", "res/harmful-tiles.png") | |||||
ctrl.set("tileImageCount", 8) | ctrl.set("tileImageCount", 8) | ||||
ctrl.set("tileImageHeight", 100) | ctrl.set("tileImageHeight", 100) | ||||
ctrl.set("tileImageWidth", 75) | ctrl.set("tileImageWidth", 75) | ||||
ctrl.set("titleImage", "res/harmful-titles.png") | |||||
ctrl.set("titleImageCount", 6) | |||||
ctrl.set("titleImageHeight", 100) | |||||
ctrl.set("titleImageWidth", 700) | |||||
ctrl.set("titlePosition", [4, 1]) | |||||
ctrl.set("windowWidth", 900) | ctrl.set("windowWidth", 900) | ||||
ctrl.set("windowHeight", 600) | ctrl.set("windowHeight", 600) | ||||
ctrl.set("windowAntialiasing", False) | ctrl.set("windowAntialiasing", False) | ||||
@@ -28,6 +28,11 @@ class memory_Context: | |||||
self.tileImageHeight = 0 | self.tileImageHeight = 0 | ||||
self.tileImageWidth = 0 | self.tileImageWidth = 0 | ||||
self.tilePositions = [] | self.tilePositions = [] | ||||
self.titleImage = "" | |||||
self.titleImageCount = 0 | |||||
self.titleImageHeight = 0 | |||||
self.titleImageWidth = 0 | |||||
self.titlePosition = [] | |||||
self.windowBackgroundColor = "#000000" | self.windowBackgroundColor = "#000000" | ||||
self.windowHeight = 0 | self.windowHeight = 0 | ||||
self.windowTitle = "" | self.windowTitle = "" | ||||