Asset refactor
This commit is contained in:
44
assets/scene/main_menu/main_menu.lua
Normal file
44
assets/scene/main_menu/main_menu.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
module('spritebatch')
|
||||
module('camera')
|
||||
module('color')
|
||||
module('ui')
|
||||
module('screen')
|
||||
module('time')
|
||||
module('text')
|
||||
module('tileset')
|
||||
module('texture')
|
||||
module('input')
|
||||
module('shader')
|
||||
module('locale')
|
||||
|
||||
screenSetBackground(colorCornflowerBlue())
|
||||
camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
|
||||
|
||||
function sceneDispose()
|
||||
end
|
||||
|
||||
function sceneUpdate()
|
||||
end
|
||||
|
||||
function sceneRender()
|
||||
-- Update camera
|
||||
camera.top = screenGetHeight()
|
||||
camera.right = screenGetWidth()
|
||||
|
||||
shaderBind(SHADER_UNLIT)
|
||||
proj = cameraGetProjectionMatrix(camera)
|
||||
shaderSetMatrix(SHADER_UNLIT, SHADER_UNLIT_PROJECTION, proj)
|
||||
view = cameraGetViewMatrix(camera)
|
||||
shaderSetMatrix(SHADER_UNLIT, SHADER_UNLIT_VIEW, view)
|
||||
|
||||
-- shaderSetTexture(SHADER_UNLIT, SHADER_UNLIT_TEXTURE, nil)
|
||||
-- spriteBatchPush(
|
||||
-- 32, 32,
|
||||
-- 64, 64,
|
||||
-- colorWhite()
|
||||
-- )
|
||||
-- spriteBatchFlush()
|
||||
|
||||
textDraw(10, 10, "Hello World\nHow are you?", colorRed())
|
||||
spriteBatchFlush()
|
||||
end
|
||||
Reference in New Issue
Block a user