Skip to content

Instantly share code, notes, and snippets.

@nucleartide
Created August 10, 2014 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nucleartide/0be23c16e20e9acf6271 to your computer and use it in GitHub Desktop.
Save nucleartide/0be23c16e20e9acf6271 to your computer and use it in GitHub Desktop.
Testing out GamePlay3D ♥
function initialize()
-- Display splash screen for at least 1 second.
ScreenDisplayer.start("drawSplash", 1000)
ScreenDisplayer.finish()
end
function drawSplash()
local game = Game.getInstance()
game:clear(Game.CLEAR_COLOR_DEPTH, 0, 0, 0, 1, 1.0, 0)
local batch = SpriteBatch.create("res/lua-logo.png")
batch:start()
batch:draw(game:getWidth() * 0.5, game:getHeight() * 0.5, 0.0, -- (x, y, z)
512.0, 512.0, -- (sprite width, sprite height)
0.0, 1.0, -- (u1, v1)
1.0, 0.0, -- (u2, v2)
Vector4.one(), -- Tint color.
true) -- Position specified above is sprite center.
batch:finish()
end
function update(elapsedTime)
end
function render(elapsedTime)
-- Clear the color and depth buffers.
Game.getInstance():clear(Game.CLEAR_COLOR_DEPTH, Vector4.zero(), 1.0, 0)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment