See if dolphin will render the floating text demo
Some checks failed
Build Dusk / run-tests (push) Successful in 1m6s
Build Dusk / build-linux (push) Failing after 1m12s
Build Dusk / build-psp (push) Successful in 2m0s
Build Dusk / build-dolphin (push) Successful in 2m41s

This commit is contained in:
2026-02-08 10:09:45 -06:00
parent 53dd36efdd
commit 03cf4a9efe
2 changed files with 35 additions and 48 deletions

View File

@@ -5,62 +5,40 @@ module('color')
module('text')
module('screen')
module('time')
module('map')
-- module('map')
module('glm')
screenSetBackground(colorLime())
screenSetBackground(colorBlack())
-- mapLoad('map/testmap/testmap.dmf')
camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
mapCamera = cameraCreate()
text = "Hello, Dusk!"
x = -35
y = 0
text = "Hello World"
function sceneDispose()
end
function sceneUpdate()
end
function sceneRender()
mapCamera.position = vec3(50, 50, 50)
cameraPushMatrix(mapCamera)
textDraw(x, y, text, colorBlue())
spriteBatchFlush()
-- 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
-- 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
end

View File

@@ -115,6 +115,15 @@ void cameraPushMatrix(camera_t *camera) {
break;
case CAMERA_VIEW_TYPE_2D:
guOrtho(
guProjection,
camera->orthographic.top,
camera->orthographic.bottom,
camera->orthographic.left,
camera->orthographic.right,
camera->nearClip,
camera->farClip
);
assertUnreachable("2D camera not implemented");
break;