Defines a Engine with mouse/touch management. The scene is always maximized and centered on screen with preservation of its aspect ratio (Adds borders when needed)
Scene width
Scene height
Optional custom screen loader
Whether drag is complete
Functions used to manage events
Is touch currently used to zoom
Maximum zoom value
Minimum zoom value
Mouse control enabled
Mouse control enabled with sprites
Mouse movement control enabled
Current mouse movement
Previous position
Current screen
Sprites defined in current screen
Current touch zoom state
Zoom (scroll / touch)
Current zoom state
Default background color used when nothing is specified for a Screen
Zoom ratio used for mouse scroll wheel
Screen height
Screen width
Loads an image, adds it to the cache (If not already done)
Absolute or relative path to the image
An image or null if not found
Caches a new GameScreen instance
Key associated to the screen
New screen to reference
current engine core (to chain screen definitions)
Adds sprite to screen. A sprite is inserted only once in a Screen
Sprite to add
true if the Sprite is added (false if already present)
Disables mouse and touch click events.
Disables mouse and touch drag events.
Disables mouse wheel and touch pinch events.
Enables mouse and touch click events. Current Screen must implement ClickListener interface
How mouse events should be managed
Enables mouse and touch drag events. Current Screen must implement DragListener interface.
Enables mouse wheel and touch pinch events. Current Screen must implement ZoomListener interface.
Forces update of sprites hierarchy. Should be used when index of sprites is updated.
Loads object from cache
id of the object to load
Converts screen coords of event to Screen coords
Source event
The screen coordinates of the event
Loads an image. Equivalent to addImage
Absolute or relative path to the image
An image or null if not found
Listens mouse down events to manage both click and drag events
Source event
Reset state when zoom touch ends
Source event
Listens move events to manage drag events
Source event
Listens mouse up events to manage both click and drag events
Source event
Listens zoom events
Source event
Removes instance of sprite
Sprite to remove
true if the sprite is really removed (false if not present)
Refreshes scene. Renders background and sprites on offest canvas
Adapts view to a new screen size
Resize event
Defines current background image. The image is not distorted to fit the screen.
The new background image. May be either an image, its relative or absolute url or a canvas
How background should be displayed
Defines current background color. Has no effect if a background image is already defined for the current screen. See also setBackground.
The new background color
Centers scene. This setting has no effect if there's no overflow
New centered position. Use null to set center in the middle of the scene
Stores object to cache
id of the object to store
object to store
Changes overflow state
New overflow state
Defines new zoom value. Ignored without enableZoomControl
New zoom value, within the minZoom - maxZoom limits
Changes displayed GameScreen. Use key when possible. See also addScreen.
Key of referenced screen or new instance of screen
Generated using TypeDoc
Defines the engine used to render scenes (aka GameScreens) with support for mouse and touch events.