Global Variables

A set of (core) variables designed to save typing and time, period.

Variable(s) Equivalent To
w, h display.contentWidth, display.contentHeight
centerX, centerY display.actualContentWidth, display.actualContentWidth
fullw, fullh display.actualContentWidth, display.actualContentWidth
unusedWidth, unusedHeight fullw - w and fullh - h respetively.
left, right, top, bottom Calculated positions for the true edges of the screen, regardless of scaling used.

Global Functions

A set of (core) functions designed to save time writing common code.

Runtime:* Improvements

The following functions improve on the Runtime:* event functions.

Syntax Summary
listen( name, listener ) Shorthand equivalent to Runtime:addEventListner( event, listener )
ignore( name, listener ) Shorthand equivalent to Runtime:removeEventListner( event, listener )
ignoreList( list, obj ) Removes all listeners in table list if found on obj.
post( name, [ params [, debuglvl ]] ) Dispatches name event with optional params table.
autoIgnore( name, obj ) Stop listening for name event if obj is invalid.

General

A (small) set of utility functions that I use very frequently.

Syntax Summary
fnn( ... ) Return first argument from list that is not nil.
round( val [ , n ]) Rounds a number to the nearest decimal place.
nextFrame( func ) Execute func in new frame. (Credit: Sergey Lerg)

RoamingGamer Copyright © Roaming Gamer, LLC. 2008-2016; All Rights Reserved