Михаил Капелько 5 months ago
parent
commit
67ee11e56e
4 changed files with 23 additions and 4 deletions
  1. +2
    -4
      v5/gui.py
  2. +11
    -0
      v5/gui_aux.py
  3. +5
    -0
      v5/main-gui.py
  4. +5
    -0
      v5/memory_Context.py

+ 2
- 4
v5/gui.py View File

@@ -67,10 +67,8 @@ def gui_generateTilePositions(

ps = []
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


+ 11
- 0
v5/gui_aux.py View File

@@ -1,3 +1,4 @@
from memory_Context import *

# 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]
#}

+ 5
- 0
v5/main-gui.py View File

@@ -108,6 +108,11 @@ ctrl.set("tileImage", "res/harmful-tiles.png")
ctrl.set("tileImageCount", 8)
ctrl.set("tileImageHeight", 100)
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("windowHeight", 600)
ctrl.set("windowAntialiasing", False)


+ 5
- 0
v5/memory_Context.py View File

@@ -28,6 +28,11 @@ class memory_Context:
self.tileImageHeight = 0
self.tileImageWidth = 0
self.tilePositions = []
self.titleImage = ""
self.titleImageCount = 0
self.titleImageHeight = 0
self.titleImageWidth = 0
self.titlePosition = []
self.windowBackgroundColor = "#000000"
self.windowHeight = 0
self.windowTitle = ""


Loading…
Cancel
Save