GLOBAL_METHODS Class
Global methods
Item Index
Methods
cgsgClearContext
-
context
Wipes the canvas context
Parameters:
-
context
CanvasRenderingContext2Dcontext to render on
cgsgDetectCurrentExplorer
()
cgsgExist
-
o
Parameters:
-
o
Object
Returns:
true if the parameter !== null && !== undefined && (!isNaN(o) && isFinite(o))
cgsgFree
-
object
Free the given object and notify listeners with appropriate event.
Parameters:
-
object
cgsgGetCursorPositions
-
event
-
canvas
Return the mouse or touch positions relative to the canvas
Parameters:
-
event
Eventa touch or mouse Event
-
canvas
HTMLElementa handler to the Canvas element
Returns:
Array of CGSGPosition object
cgsgGetDisplayedViewportDimension
()
CGSGDimension
Returns:
a CGSGDimension as the viewport region
cgsgGetRealViewportDimension
()
CGSGDimension
Returns:
a CGSGDimension as the real viewport dimension
cgsgIterate
-
array
-
callback
Iterates the given array and, at each iteration, calls the given callback function. The loop stops if the callback function returns false.
Optimized loop is used here and should be prefer to other approaches, especially on old browser versions and IE.
cgsgIterateReverse
-
array
-
callback
Iterates the given array from the end to the beginning of the array. The loop stops if the callback function returns false.
Prefer to use this method for the same reasons than cgsgIterate.