Files
dusk/assets/scene/initial.lua
2026-02-05 08:43:49 -06:00

60 lines
1.3 KiB
Lua

module('spritebatch')
module('camera')
module('color')
-- module('ui')
module('text')
module('screen')
module('time')
module('map')
module('glm')
screenSetBackground(colorLime())
mapCamera = cameraCreate()
text = "Hello, Dusk!"
function sceneDispose()
end
function sceneUpdate()
end
function sceneRender()
mapCamera.position = vec3(4, 4, 4)
cameraPushMatrix(mapCamera)
spriteBatchPush(nil, -1, -1, 1, 1, colorBlue())
spriteBatchFlush()
cameraPopMatrix()
end
-- screenSetBackground(colorBlack())
-- mapLoad('map/testmap/testmap.dmf')
-- camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
-- mapCamera = cameraCreate()
-- text = "Hello World"
-- function sceneDispose()
-- end
-- function sceneUpdate()
-- end
-- function sceneRender()
-- -- Map Test
-- mapCamera.position = vec3(300, 300, 300)
-- cameraPushMatrix(mapCamera)
-- mapRender()
-- cameraPopMatrix()
-- -- UI Test
-- cameraPushMatrix(camera)
-- camera.bottom = screenGetHeight()
-- camera.right = screenGetWidth()
-- width, height = textMeasure(text)
-- x = (screenGetWidth() - width)
-- x = math.sin(TIME.time * 2) * (x / 2) + (x / 2)
-- y = (screenGetHeight() - height) / 2
-- y = math.cos(TIME.time * 3) * (y) + (y)
-- textDraw(x, y, text, colorMagenta())
-- cameraPopMatrix()
-- end