d
This commit is contained in:
@@ -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,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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user