Texture loading
This commit is contained in:
@@ -52,4 +52,4 @@ else
|
||||
end
|
||||
|
||||
localeSet(DUSK_LOCALE_EN_US)
|
||||
sceneSet('scene/initial.dsf')
|
||||
sceneSet('scene/minesweeper.dsf')
|
||||
@@ -5,10 +5,16 @@ module('ui')
|
||||
module('screen')
|
||||
module('time')
|
||||
module('glm')
|
||||
module('text')
|
||||
module('tileset')
|
||||
module('texture')
|
||||
|
||||
screenSetBackground(colorBlack())
|
||||
camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
|
||||
|
||||
tileset = tilesetGetByName("ui")
|
||||
ui = textureLoad(tileset.texture)
|
||||
|
||||
function sceneDispose()
|
||||
end
|
||||
|
||||
@@ -21,7 +27,17 @@ function sceneRender()
|
||||
camera.bottom = screenGetHeight()
|
||||
camera.right = screenGetWidth()
|
||||
|
||||
|
||||
slice = tilesetTileGetUV(tileset, 0)
|
||||
spriteBatchPush(ui,
|
||||
0, 0,
|
||||
ui.width * slice.u1, ui.height * slice.v1,
|
||||
colorRainbow(),
|
||||
slice.u0, slice.v0,
|
||||
slice.u1, slice.v1
|
||||
)
|
||||
spriteBatchFlush()
|
||||
|
||||
-- textDraw(0, 0, "Hello World", colorRainbow())
|
||||
|
||||
cameraPopMatrix()
|
||||
end
|
||||
Reference in New Issue
Block a user