class lime.app.Application extends Module

Available on all platforms

The Application class forms the foundation for most Lime projects. It is common to extend this class in a main class. It is then possible to override "on" functions in the class in order to handle standard events that are relevant.

Class Fields

static var current:Application

Instance Fields

var onUpdate:Event_Int_Void<Int ->Void>

Update events are dispatched each frame (usually just before rendering)

function new():Void

function addModule(module:IModule):Void

Adds a new module to the Application

module

A module to add

function addRenderer(renderer:Renderer):Void

Adds a new Renderer to the Application. By default, this is called automatically by create()

renderer

A Renderer object to add

function create(config:Config):Void

Initializes the Application, using the settings defined in the config instance. By default, this is called automatically when building the project using Lime's command-line tools

config

A Config object

function createWindow(window:Window):Void

Adds a new Window to the Application. By default, this is called automatically by create()

window

A Window object to add

function exec():Int

Execute the Application. On native platforms, this method blocks until the application is finished running. On other platforms, it will return immediately

returns

An exit code, 0 if there was no error

function onGamepadAxisMove(gamepad:Gamepad, axis:GamepadAxis, value:Float):Void

function onGamepadButtonDown(gamepad:Gamepad, button:GamepadButton):Void

function onGamepadButtonUp(gamepad:Gamepad, button:GamepadButton):Void

function onGamepadConnect(gamepad:Gamepad):Void

function onGamepadDisconnect(gamepad:Gamepad):Void

function onJoystickAxisMove(joystick:Joystick, axis:Int, value:Float):Void

function onJoystickButtonDown(joystick:Joystick, button:Int):Void

function onJoystickButtonUp(joystick:Joystick, button:Int):Void

function onJoystickConnect(joystick:Joystick):Void

function onJoystickHatMove(joystick:Joystick, hat:Int, position:JoystickHatPosition):Void

function onJoystickTrackballMove(joystick:Joystick, trackball:Int, value:Float):Void

function onKeyDown(window:Window, keyCode:KeyCode, modifier:KeyModifier):Void

function onKeyUp(window:Window, keyCode:KeyCode, modifier:KeyModifier):Void

function onModuleExit(code:Int):Void

function onMouseDown(window:Window, x:Float, y:Float, button:Int):Void

function onMouseMove(window:Window, x:Float, y:Float):Void

function onMouseMoveRelative(window:Window, x:Float, y:Float):Void

function onMouseUp(window:Window, x:Float, y:Float, button:Int):Void

function onMouseWheel(window:Window, deltaX:Float, deltaY:Float):Void

function onPreloadProgress(loaded:Int, total:Int):Void

function onRenderContextLost(renderer:Renderer):Void

function onTextEdit(window:Window, text:String, start:Int, length:Int):Void

function onTextInput(window:Window, text:String):Void

function onTouchEnd(touch:Touch):Void

function onTouchMove(touch:Touch):Void

function onTouchStart(touch:Touch):Void

function onWindowActivate(window:Window):Void

function onWindowClose(window:Window):Void

function onWindowCreate(window:Window):Void

function onWindowDeactivate(window:Window):Void

function onWindowEnter(window:Window):Void

function onWindowFocusIn(window:Window):Void

function onWindowFocusOut(window:Window):Void

function onWindowFullscreen(window:Window):Void

function onWindowLeave(window:Window):Void

function onWindowMinimize(window:Window):Void

function onWindowMove(window:Window, x:Float, y:Float):Void

function onWindowResize(window:Window, width:Int, height:Int):Void

function onWindowRestore(window:Window):Void

function removeModule(module:IModule):Void

Removes a module from the Application

module

A module to remove

function removeRenderer(renderer:Renderer):Void

Removes a Renderer from the Application

renderer

A Renderer object to remove

function render(renderer:Renderer):Void

function update(deltaTime:Int):Void