|
|
Callback
load( )
This function is called exacly once at the beginning of the game. This is where
resources such as images and sounds should be loaded.
Synopsis
function load( ) ... end
Arguments
(None)
Returns
(Nothing)
Examples
Example 51: Basic callbacks
elapsed = 0 -- Load: called when the game -- loads. function load() -- Load a font local f = love.graphics.newFont(love.default_font, 12) love.graphics.setFont(f) end -- Update: Called each frame. Update the -- state of your game here. function update(dt) elapsed = elapsed + dt end -- Draw: Called each frame. The game -- should be drawn in this functions. function draw() love.graphics.draw("Elapsed time: " .. elapsed, 100, 100) end
Copyright © 2006-2008 LÖVE Development Team.
|