Show:

GLOBAL_METHODS Class

Module: Util

Global methods

Methods

cgsgClearContext
(
  • context
)
private

Wipes the canvas context

Parameters:
  • context CanvasRenderingContext2D

    context to render on

cgsgDetectCurrentExplorer ()
cgsgExist
(
  • object
)
Boolean
Parameters:
Returns:
Boolean: true if the parameter !== null && !== undefined
cgsgFree
(
  • object
)
Parameters:
  • object
cgsgGetCursorPositions
(
  • event
  • canvas
)
Array

Return the mouse or touch positions relative to the canvas

Parameters:
  • event Event

    a touch or mouse Event

  • canvas HTMLElement

    a handler to the Canvas element

Returns:
Array: Array of CGSGPosition object
cgsgGetDisplayedViewportDimension () CGSGDimension
Returns:
CGSGDimension: a CGSGDimension as the viewport region
cgsgGetRealViewportDimension () CGSGDimension
Returns:
CGSGDimension: a CGSGDimension as the real viewport dimension
cgsgPointIsInRegion
(
  • point
  • targetRegion
  • threshold
)
Boolean
Parameters:
  • point Object

    a CGSGPosition

  • targetRegion Object

    a CGSGRegion

  • threshold Object

    an integer

Returns:
Boolean: true if the point is inside the region or around this one in a distance of threshold
cgsgRegionIsInRegion
(
  • region
  • targetRegion
  • threshold
)
Boolean
Parameters:
Returns:
Boolean: true if the point is inside the region or around this one in a distance of threshold