flatworld.objects.ObjectSprite Class
The base class of all sprite objects
Constructor
flatworld.objects.ObjectSprite
-
coords -
{}
Item Index
Methods
Attributes
Methods
drawNewFrame
-
x -
y -
newFrame
Draws new frame to animate or such
Parameters:
Returns:
this object instance
getGraphicalArea
-
options
Get the area that is reserved for the graphical presenation of this object as a rectangle.
Parameters:
-
optionsObjecttoGlobal: Boolean. Should the method return global coordinates or local (movableLayer)
Returns:
{ x: Number, y: Number, width: Number, height: Number}
Attributes
areaHeight
Number
Object area height in pixels.
Fires event areaHeightChange
Fires when the value for the configuration attribute areaHeight is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
eEventFacadeAn Event Facade object with the following attribute-specific properties added:
areaWidth
Number
Object area width in pixels.
Fires event areaWidthChange
Fires when the value for the configuration attribute areaWidth is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
eEventFacadeAn Event Facade object with the following attribute-specific properties added:
data
Object
Objects custom data. Holds unit statistics and most data. Like unit movement speed etc.
Fires event dataChange
Fires when the value for the configuration attribute data is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
eEventFacadeAn Event Facade object with the following attribute-specific properties added:
highlightable
Boolean
Is the object highligtable.
Fires event highlightableChange
Fires when the value for the configuration attribute highlightable is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
eEventFacadeAn Event Facade object with the following attribute-specific properties added:
name
String
Name of the object. Used mostly for debugging
Fires event nameChange
Fires when the value for the configuration attribute name is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
eEventFacadeAn Event Facade object with the following attribute-specific properties added:
static
Boolean
If this object is static. Meaning it's position won't be changed etc. This can be used e.g. in rendering the minimap. The static objects and then the dynamic separately.
Fires event staticChange
Fires when the value for the configuration attribute static is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
eEventFacadeAn Event Facade object with the following attribute-specific properties added:
type
String
Type of the object. Can be used for filtering, ordering or finding correct objects.
Fires event typeChange
Fires when the value for the configuration attribute type is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
eEventFacadeAn Event Facade object with the following attribute-specific properties added:
