|
- from memory_Context import *
-
- # Generate grid positions in cell dimensions
- #
- # Conditions:
- # 1. 2x2 grid
- # 2. 4x4 grid
- def gui_aux_cellGridPositions(
- size: int
- ) -> [[int]]:
- if (
- size == 2
- ):
- return [
- [14, 7],
- [19, 7],
- [14, 13],
- [19, 13],
- ]
- #}
-
- if (
- size == 4
- ):
- return [
- [9, 1],
- [14, 1],
- [19, 1],
- [24, 1],
-
- [9, 7],
- [14, 7],
- [19, 7],
- [24, 7],
-
- [9, 13],
- [14, 13],
- [19, 13],
- [24, 13],
-
- [9, 19],
- [14, 19],
- [19, 19],
- [24, 19],
- ]
- #}
- #}
-
- # 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]
- #}
|