Михаил Капелько před 5 měsíci
rodič
revize
72ccd9f37b
3 změnil soubory, kde provedl 26 přidání a 2 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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()

Načítá se…
Zrušit
Uložit