See if dolphin will render the floating text demo
This commit is contained in:
@@ -5,62 +5,40 @@ module('color')
|
|||||||
module('text')
|
module('text')
|
||||||
module('screen')
|
module('screen')
|
||||||
module('time')
|
module('time')
|
||||||
module('map')
|
-- module('map')
|
||||||
module('glm')
|
module('glm')
|
||||||
|
|
||||||
screenSetBackground(colorLime())
|
screenSetBackground(colorBlack())
|
||||||
|
-- mapLoad('map/testmap/testmap.dmf')
|
||||||
|
camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
|
||||||
mapCamera = cameraCreate()
|
mapCamera = cameraCreate()
|
||||||
text = "Hello, Dusk!"
|
|
||||||
|
|
||||||
x = -35
|
text = "Hello World"
|
||||||
y = 0
|
|
||||||
|
|
||||||
function sceneDispose()
|
function sceneDispose()
|
||||||
end
|
end
|
||||||
|
|
||||||
function sceneUpdate()
|
function sceneUpdate()
|
||||||
end
|
end
|
||||||
|
|
||||||
function sceneRender()
|
function sceneRender()
|
||||||
mapCamera.position = vec3(50, 50, 50)
|
-- Map Test
|
||||||
cameraPushMatrix(mapCamera)
|
-- mapCamera.position = vec3(300, 300, 300)
|
||||||
|
-- cameraPushMatrix(mapCamera)
|
||||||
textDraw(x, y, text, colorBlue())
|
-- mapRender()
|
||||||
|
-- cameraPopMatrix()
|
||||||
spriteBatchFlush()
|
|
||||||
|
-- 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()
|
cameraPopMatrix()
|
||||||
end
|
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
|
|
||||||
@@ -115,6 +115,15 @@ void cameraPushMatrix(camera_t *camera) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CAMERA_VIEW_TYPE_2D:
|
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");
|
assertUnreachable("2D camera not implemented");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user