Added sorting layers to nodes

This commit is contained in:
2023-06-29 13:47:35 +10:00
parent 51a0c94ba2
commit 2d6ad5efcc
10 changed files with 39 additions and 44 deletions

View File

@@ -5,10 +5,15 @@ var TILE_PIXEL_HEIGHT: int const = 16;
var MAP_GRID_WIDTH: int const = 16;
var MAP_GRID_HEIGHT: int const = 16;
var CAMERA_SCREEN_W: int const = 800;
var CAMERA_SCREEN_H: int const = 600;
var CAMERA_SCALE_X: float const = 2.0;
var CAMERA_SCALE_Y: float const = 2.0;
//this is a very odd pattern...
var globalCameraX: int = 0;
var globalCameraY: int = 0;
//A quirk of the setup is that anything defined in the root of `init.toy` becomes a global object
//To resolve that, the configuration is inside a block scope
@@ -45,12 +50,7 @@ var CAMERA_SCALE_Y: float const = 2.0;
//this function must always be called, or the engine won't run
initWindow(
"Airport",
floor(TILE_PIXEL_WIDTH * MAP_GRID_WIDTH * CAMERA_SCALE_X),
floor(TILE_PIXEL_HEIGHT * MAP_GRID_HEIGHT * CAMERA_SCALE_Y) + 32, //32 is UI space
false);
//TODO: custom FPS setting
initWindow("Skylands", CAMERA_SCREEN_W, CAMERA_SCREEN_H, false); //TODO: custom FPS setting
//kick off the logic of the scene graph
loadRootNode("scripts:/gameplay/scene.toy");