-
Notifications
You must be signed in to change notification settings - Fork 2
Application
The Application class contains Screens, which in turn contain all the graphical components on the screen. It is the root node of any program.
Application( string name, string path = name )Application:onUpdate( number deltaTime )Called when the Application updates.
Application:onLoad()Called when the Application loads before being run.
Application.name - string
The name of the Application.
Application.path - string
The path to Application files.
Application.terminateable - boolean
Specifies whether the Application should stop upon receiving a terminate event.
Application.running - boolean
true when the Application is running, false when not.
Application:registerResourceLoader( string type, function loader )Registers a loader to be used with the resource type given.
Application:unregisterResourceLoader( string type )Unregisters the loader from the resource type given.
Application:registerFileExtension( string extension, string type )Registers an extension to be associated with a type. If Application:loadResource() is not given a type, its type will be inferred from its extension.
Application:unregisterFileExtension( string extension )Unregisters a file extension.
data = Application:loadResource( string resource, optional string type )Loads a resource, looking in the application path and root. If type is not given, it will be inferred from the extension of the resource.
Thread thread = Application:addThread( Thread thread )Adds a thread to be resumed by the application, and returns it.
boolean pressed = Application:isKeyPressed( string key )Returns whether the user is holding the key given.
Screen screen = Application:addScreen()Adds a blank Screen to the Application.
Application:removeScreen( Screen screen )Removes a screen from the Application.
Application:stop()Stops the Application from running (exiting Application:run())
Application:run()Runs the Application, calling load() at the beginning, and catching exceptions thrown.
This is an internal callback.
Application:event( string event, ... )Used to pass CC formatted events to child Screens.
This is an internal callback.
Application:draw()Used to draw child Screens.
This is an internal callback.
Application:update()Used to update child Screens, while getting the dt using timer.getDelta().
This is an internal callback.
Application:load()Triggers the onLoad() callback and starts the Application.
- Exception
- DynamicValueException
- ExpressionException
- IncorrectConstructorException
- IncorrectParameterException
- ParserException
- ResourceLoadException
- ThreadRuntimeException