Михаил Капелько 1 tydzień temu
rodzic
commit
72ccd9f37b
3 zmienionych plików z 26 dodań i 2 usunięć
  1. +16
    -1
      v5/desktop.py
  2. +2
    -0
      v5/desktop_Platform.py
  3. +8
    -1
      v5/main-gui.py

+ 16
- 1
v5/desktop.py Wyświetl plik

@@ -1,6 +1,6 @@
import arcade
from desktop_Platform import *

# Configure window parameters
def desktop_configureFixedWindow(p):
p.cell = 25
p.windowAntialiasing = False
@@ -8,3 +8,18 @@ def desktop_configureFixedWindow(p):
p.windowTitle = "OGS Memory"
p.windowWidth = 900
#}

def desktop_loadTextures(p):
texs = []
for (id, td) in enumerate(p.c.textureDescriptions):
tex = arcade.load_texture(
td.fileName,
x = td.x,
y = td.y,
width = td.width,
height = td.height
)
texs.append(tex)
#}
p.textures = texs
#}

+ 2
- 0
v5/desktop_Platform.py Wyświetl plik

@@ -2,8 +2,10 @@ import arcade

class desktop_Platform:
def __init__(self):
self.c = None
self.cell = 0
self.sprites = arcade.SpriteList()
self.textures = []
self.title = ""
self.windowBackgroundColor = arcade.color.WHITE
self.windowHeight = 0


+ 8
- 1
v5/main-gui.py Wyświetl plik

@@ -76,6 +76,13 @@ def printOutput(c):
ctrl.registerCallback(printOutput)
ctrl.registerFieldCallback("exit", lambda c: sys.exit(0))

p = desktop_Platform()

# Copy context to platform.
def copyContext(c):
p.c = c
ctrl.registerCallback(copyContext)

ctrl.set("didLaunch", True)
ctrl.set("playfieldSize", 2)
ctrl.set("tileImage", "res/tiles.png")
@@ -83,8 +90,8 @@ ctrl.set("tileImageCount", 3)
ctrl.set("tileImageHeight", 100)
ctrl.set("tileImageWidth", 75)

p = desktop_Platform()
desktop_configureFixedWindow(p)
desktop_loadTextures(p)

wnd = desktop_Window(p)
arcade.run()

Ładowanie…
Anuluj
Zapisz