| Package | org.ffilmation.engine.elements |
| Class | public class fObject |
| Inheritance | fObject fRenderableElement fElement flash.events.EventDispatcher |
| Subclasses | fCharacter |
An Object is a graphic element that is part of the the environment and is not projected in any way. The library item is attached to the scene as is. Objects cast and receive shadows.
Trees, statues and furniture are typical examples of objects.
Objects can't be moved and can't be added/removed dynamically because this allows several rendering optimizations. If you want to move something or add/remove it on the fly use the "Character" class instead
YOU CAN'T CREATE INSTANCES OF THIS OBJECT.
Objects are created when the scene is processed
See also
| Property | Defined by | ||
|---|---|---|---|
| animated : Boolean
This property provides a bit of rendering optimization.
| fObject | ||
![]() | castShadows : Boolean = true
Boolean value indicating if this object casts shadows.
| fRenderableElement | |
![]() | container : MovieClip WARNING!!!: This property only exists when the scene is being rendered and the graphic elements have been created. | fRenderableElement | |
![]() | controller : fEngineElementController
Assigns a controller to this element
| fElement | |
![]() | customData : Object
As elements are not defined as "dynamic", this property can be used to store extra info about this element at run-time.
| fElement | |
| definitionID : String
The definition ID for this fObject.
| fObject | ||
![]() | flashClip : MovieClip
A reference to the library movieclip that was attached to create the element, so you
can acces methods inside, nested clips or whatever
| fRenderableElement | |
| height : Number
The height in pixels of an imaginary cilinder enclosing the object.
| fObject | ||
![]() | id : String
The string identifier of this element.
| fElement | |
| orientation : Number
The orientation (in degrees) of the object along the Z axis.
| fObject | ||
| radius : Number [read-only]
The radius in pixels of an imaginary cilinder enclosing the object.
| fObject | ||
![]() | receiveLights : Boolean = true
Boolean value indicating if this object receives lighting.
| fRenderableElement | |
![]() | receiveShadows : Boolean = true
Boolean value indicating if this object receives shadows.
| fRenderableElement | |
![]() | solid : Boolean = true
Boolean value indicating if this object collides with others.
| fRenderableElement | |
![]() | x : Number
X coordinate fot this element
| fElement | |
![]() | xmlObj : XML
This is the XML node from the scene XML that generated this element.
| fElement | |
![]() | y : Number
Y coordinate for this element
| fElement | |
![]() | z : Number
Z coordinate for this element
| fElement | |
| Method | Defined by | ||
|---|---|---|---|
|
call(what:String, param:* = null):void
Calls a function of the base clip
| fObject | ||
![]() |
disableMouseEvents():void
Mouse management
| fRenderableElement | |
![]() |
distanceTo(x:Number, y:Number, z:Number):Number
Returns the distance of this element to the given coordinate
| fElement | |
![]() |
enableMouseEvents():void
Mouse management
| fRenderableElement | |
![]() |
Makes element follow target element
| fElement | |
|
gotoAndPlay(where:*):void
Passes the stardard gotoAndPLay command to the base clip
| fObject | ||
|
gotoAndStop(where:*):void
Passes the stardard gotoAndStop command to the base clip
| fObject | ||
![]() |
hide():void
Makes element invisible
| fRenderableElement | |
|
moveTo(x:Number, y:Number, z:Number):void
| fObject | ||
![]() |
show():void
Makes element visible
| fRenderableElement | |
![]() |
stopFollowing(target:fElement):void
Stops element from following another element
| fElement | |
|
updateDepth():void
| fObject | ||
| Constant | Defined by | ||
|---|---|---|---|
![]() | HIDE : String = "renderableElementHide" [static]
The fRenderableElement.HIDE constant defines the value of the
type property of the event object for a renderableElementHide event. | fRenderableElement | |
| MAXSHADOW : * = 2 [static]
Limits size of object shadow projection relative to X times the object's height (amount of stretching movieClips will suffer)
| fObject | ||
![]() | MOVE : String = "elementmove" [static]
The fElement.MOVE constant defines the value of the
type property of the event object for a elementmove event. | fElement | |
![]() | NEWCELL : String = "elementnewcell" [static]
The fElement.NEWCELL constant defines the value of the
type property of the event object for a elementnewcell event. | fElement | |
| SHADOWRANGE : * = 100 [static]
Shadows are harder or softer depending on the distance from the shadow origin to the plane where the shadow is drawn
This constant defines the max distance in pixels at which a shadow will be seen.
| fObject | ||
| SHADOWSCALE : * = 0.7 [static]
Shadows become bigger as they fade away.
| fObject | ||
![]() | SHOW : String = "renderableElementShow" [static]
The fRenderableElement.SHOW constant defines the value of the
type property of the event object for a renderableElementShow event. | fRenderableElement | |
| animated | property |
public var animated:BooleanThis property provides a bit of rendering optimization. Non-Animated objects can be rendered faster if their cacheAsBitmap property is set to true. For animated objects this would slowdown performance as the cache would be redrawn continuously. Don't confuse "animated" ( a looping movieClip ) with "moveable". fObjects default to non-animated and fCharacters default to animated. You can use the animated attribute in your XMLs to change this
| definitionID | property |
public var definitionID:StringThe definition ID for this fObject. It is useful for example when processing collision events, as it will allow you to know what kind of thing did you collide against.
| height | property |
height:Number [read-write]The height in pixels of an imaginary cilinder enclosing the object. It is used only for colision detection. You can change it anytime This is useful for example if a character has rolling or crawling movements and you want to change its collision height during those movements.
Implementation public function get height():Number
public function set height(value:Number):void
| orientation | property |
orientation:Number [read-write]The orientation (in degrees) of the object along the Z axis. That is, if the object was a man standing anywhere on our scene, this would be where was his nose pointing. The default value of 0 indicates it is "looking" towards the positive X axis. The Axis in the Filmation Engine go like this.
positive Z
|
| / positive X
| /
| /
(0,0,0) X/
\
\
\
\ positive Y
public function get orientation():Number
public function set orientation(value:Number):void
| radius | property |
radius:Number [read-only]The radius in pixels of an imaginary cilinder enclosing the object. It is used only for colision detection.
Implementation public function get radius():Number
| call | () | method |
public override function call(what:String, param:* = null):voidCalls a function of the base clip
Parameterswhat:String — Name of the function to call
|
|
param:* (default = null) — An optional extra parameter to pass to the function
|
| gotoAndPlay | () | method |
public override function gotoAndPlay(where:*):voidPasses the stardard gotoAndPLay command to the base clip
Parameterswhere:* — A frame number or frame label
|
| gotoAndStop | () | method |
public override function gotoAndStop(where:*):voidPasses the stardard gotoAndStop command to the base clip
Parameterswhere:* — A frame number or frame label
|
| moveTo | () | method |
public override function moveTo(x:Number, y:Number, z:Number):voidParameters
x:Number |
|
y:Number |
|
z:Number |
| updateDepth | () | method |
public function updateDepth():void
| MAXSHADOW | constant |
public static const MAXSHADOW:* = 2Limits size of object shadow projection relative to X times the object's height (amount of stretching movieClips will suffer)
| SHADOWRANGE | constant |
public static const SHADOWRANGE:* = 100Shadows are harder or softer depending on the distance from the shadow origin to the plane where the shadow is drawn This constant defines the max distance in pixels at which a shadow will be seen. The shadow's alpha values will fade from 1 to 0 along this distance
| SHADOWSCALE | constant |
public static const SHADOWSCALE:* = 0.7Shadows become bigger as they fade away. This is the scaling factor -1. 1 means the shadow doubles in size