Refactored and simplified lua stuff a lot.
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
module('spritebatch')
|
||||
module('time')
|
||||
-- module('time')
|
||||
module('camera')
|
||||
module('glm')
|
||||
-- module('glm')
|
||||
module('color')
|
||||
|
||||
camera = cameraCreate(CAMERA_PROJECTION_TYPE_PERSPECTIVE)
|
||||
|
||||
color = colorBlue()
|
||||
|
||||
function sceneDispose()
|
||||
-- print('Disposing initial scene')
|
||||
end
|
||||
|
||||
function sceneUpdate()
|
||||
color.r = 255 * (math.sin(TIME.time) + 1) * 0.5
|
||||
color.g = 255 * (math.sin(TIME.time + 2) + 1) * 0.5
|
||||
color.b = 255 * (math.sin(TIME.time + 4) + 1) * 0.5
|
||||
|
||||
end
|
||||
|
||||
function sceneRender()
|
||||
@@ -25,7 +21,7 @@ function sceneRender()
|
||||
nil,
|
||||
0, 0,
|
||||
1, 2,
|
||||
color
|
||||
colorBlue()
|
||||
)
|
||||
spriteBatchFlush()
|
||||
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
# 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(TILESET minogram.png type=PALETTIZED tileWidth=6 tileHeight=10 columns=16 rows=6)# Fixes PSP rendering
|
||||
add_asset(SCRIPT test.lua)
|
||||
@@ -1,6 +1,9 @@
|
||||
module('ui')
|
||||
module('color')
|
||||
module('spritebatch')
|
||||
|
||||
function draw(x, y)
|
||||
uiDrawRect(COLOR_WHITE, x, y, 32, 32)
|
||||
function render(x, y, w, h)
|
||||
spriteBatchPush(
|
||||
nil,
|
||||
x, y,
|
||||
w, h
|
||||
)
|
||||
end
|
||||
Reference in New Issue
Block a user