FLAG 3.0 GET

Tiled Object

Tiled Objects are objects that span multiple tiles but are still rendered in the same fashion as regular tiles. The tiles of a Tiled Objects are grouped together inside a frame. Tiled Objects can have multiple frames, which allows them to have animation, similar to a Sprite. Tiled Objects are created using POLE and can be manipulated using FLAG and WIND.

Class

FLAGTILEDOBJECT

Called by FLAG.TiledObject

FLAG.TiledObject( instanceName:String ); Parameters instanceName:String --- The name of a Tiled Object instance in the Scene Example
FLAG.TiledObject("myTiledObject");
Extend Class Example
FLAGTILEDOBJECT.prototype.myFunction = function(){
console.log("I added to the FLAGTILEDOBJECT Class");
};

Properties

animation:Number --- Index of Tiled Object animation col:Number --- Root column of Tiled Object frame:Number --- Frame number of the Tiled Object that is being rendered layer:Number --- Layer the Tiled Object is being rendered on loop:Boolean --- Should the Tiled Object's animation loop loopCount:Number --- How many animation loops before stopping, null if infinite loops:Number --- A counter for how many loops have occured name:String --- Name of the Tiled Object instance in the Scene pIndex:Number --- Index of the Tiled Object created in POLE playing:Boolean --- True if the Tiled Object's animation is playing row:Number --- Root row of Tiled Object

Methods

Get Animation

Returns an object containing animation information for the Tiled Object.

FLAG.TiledObject("myTiledObject").getAnimation( ); Example
console.log(FLAG.TiledObject("myTiledObject").getAnimation().name);

Play

Sets the Tiled Object's animation to play.

FLAG.TiledObject("myTiledObject").play( );

Set Animation

Sets the animation of the Tiled Object.

FLAG.TiledObject("myTiledObject").setAnimation( animation:String || Number ); Parameters animation:String || Number --- Name or index of animation for Tiled Object Example
FLAG.TiledObject("myTiledObject").setAnimation("LightsOn");

Set Frame

Sets the frame of the Tiled Object.

FLAG.TiledObject("myTiledObject").setFrame( frame:String || Number ); Parameters frame:String || Number --- "startFrame" or "endFrame" or number of frame for Tiled Object Example
FLAG.TiledObject("myTiledObject").setFrame(0);

Stop

Sets the Tiled Object's animation to stop.

FLAG.TiledObject("myTiledObject").stop( );
POLE WIND