Class: DrawImageObject

DrawImageObject

Image object to draw
Source:
See:

Extends

Members

activeAnimation :null|string

Source:

bgColor :string

Background color as rgba(r,g,b,a).
Overrides:
Source:

boundaries :Array.<Array.<number>>

Deprecated:
  • - use .vertices instead
Source:

hasAnimations :boolean

Determines if image is animated or not
Source:

height :number

Source:

image :ImageBitmap

Source:

imageIndex :number

Current image index
Source:

key :string

A key should match an image loaded through AssetsManager
Source:

spacing :number

Image spacing (for tilesets.spacing > 0)
Source:

width :number

Source:

x :number

Overrides:
Source:

y :number

Overrides:
Source:

Methods

addAnimation(eventName, animationSpriteIndexes, isRepeatedopt)

Adds image animations
Parameters:
Name Type Attributes Default Description
eventName string animation name
animationSpriteIndexes Array.<number> | Array.<{duration:number, id:number}> animation image indexes
isRepeated boolean <optional>
false animation is cycled or not, cycled animation could be stopped only with stopRepeatedAnimation();
Source:

addEventListener(eventName, listener, options)

Subscribe
Parameters:
Name Type Description
eventName string
listener *
options *
Source:

destroy()

Destroy object on next render iteration.
Overrides:
Source:

emit(eventName, …eventParams)

Emit event
Parameters:
Name Type Attributes Description
eventName string
eventParams any <repeatable>
Source:

removeAllAnimations()

Removes animations
Source:

removeEventListener(eventName, listener, options)

Unsubscribe
Parameters:
Name Type Description
eventName string
listener *
options *
Source:

setMask(mask)

Parameters:
Name Type Description
mask DrawShapeObject
Overrides:
Source:

stopRepeatedAnimation(eventNameopt)

Parameters:
Name Type Attributes Description
eventName string <optional>
animation name, if not provided - stop current active animation event
Source:

turnOffOffset()

turn off offset for specific draw object gameStageData.centerCameraPosition() will take no effect on such object Can be used for something that should be always on screen: control buttons, overlay masks etc.
Overrides:
Source: