Text
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
module('spritebatch')
|
||||
module('camera')
|
||||
module('color')
|
||||
module('ui')
|
||||
-- module('ui')
|
||||
module('text')
|
||||
module('screen')
|
||||
module('time')
|
||||
|
||||
camera = cameraCreate(CAMERA_PROJECTION_TYPE_PERSPECTIVE)
|
||||
|
||||
uiPush('ui/test.dsf')
|
||||
camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
|
||||
|
||||
function sceneDispose()
|
||||
end
|
||||
@@ -13,16 +14,22 @@ end
|
||||
function sceneUpdate()
|
||||
end
|
||||
|
||||
text = "Hello World"
|
||||
|
||||
function sceneRender()
|
||||
cameraPushMatrix(camera)
|
||||
|
||||
spriteBatchPush(
|
||||
nil,
|
||||
0, 0,
|
||||
1, 2,
|
||||
colorBlue()
|
||||
)
|
||||
spriteBatchFlush()
|
||||
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)
|
||||
|
||||
cameraPopMatrix()
|
||||
end
|
||||
@@ -3,5 +3,4 @@
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
add_asset(TILESET minogram.png type=PALETTIZED tileWidth=6 tileHeight=10 columns=16 rows=6)# Fixes PSP rendering
|
||||
add_asset(SCRIPT test.lua)
|
||||
add_asset(TILESET minogram.png type=PALETTIZED tileWidth=6 tileHeight=10 columns=16 rows=6)# Fixes PSP rendering
|
||||
@@ -1,9 +0,0 @@
|
||||
module('spritebatch')
|
||||
|
||||
function uiElementRender(x, y, w, h)
|
||||
spriteBatchPush(
|
||||
nil,
|
||||
x, y,
|
||||
w, h
|
||||
)
|
||||
end
|
||||
Reference in New Issue
Block a user