Map loading
This commit is contained in:
@@ -38,5 +38,4 @@ else
|
||||
end
|
||||
|
||||
localeSet(DUSK_LOCALE_EN_US)
|
||||
sceneSet('scene/initial.dsf')
|
||||
-- mapLoad('map/testmap/testmap.dmf')
|
||||
sceneSet('scene/initial.dsf')
|
||||
@@ -3,5 +3,4 @@
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
add_asset(MAP testmap.json)
|
||||
add_asset(SCRIPT testmap.lua)
|
||||
add_asset(MAP testmap.json)
|
||||
@@ -1 +0,0 @@
|
||||
print('Test Map Script Run')
|
||||
@@ -5,10 +5,15 @@ module('color')
|
||||
module('text')
|
||||
module('screen')
|
||||
module('time')
|
||||
module('map')
|
||||
module('glm')
|
||||
|
||||
camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
|
||||
text = "Hello World"
|
||||
screenSetBackground(colorBlack())
|
||||
mapLoad('map/testmap/testmap.dmf')
|
||||
camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
|
||||
mapCamera = cameraCreate()
|
||||
|
||||
text = "Hello World"
|
||||
|
||||
function sceneDispose()
|
||||
end
|
||||
@@ -17,19 +22,23 @@ function sceneUpdate()
|
||||
end
|
||||
|
||||
function sceneRender()
|
||||
cameraPushMatrix(camera)
|
||||
-- Map Test
|
||||
cameraPushMatrix(mapCamera)
|
||||
mapCamera.position = vec3(300, 300, 300)
|
||||
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)
|
||||
textDraw(x, y, text, colorMagenta())
|
||||
|
||||
cameraPopMatrix()
|
||||
end
|
||||
Reference in New Issue
Block a user