| Package | org.ffilmation.engine.elements |
| Class | public class fCharacter |
| Inheritance | fCharacter fObject fRenderableElement fElement flash.events.EventDispatcher |
A Character is a dynamic object in the scene. Characters can move and rotate, and can be added and removed from the scene at any time. Live creatures and vehicles are the most common uses for the fCharacter class.
There are other uses for fCharacter: If you want a chair to be "moveable", for example, you will have to make it a fCharacter.
You can add the parameter dynamic="true" to the XML definition for any object you want to be able to move later. This will force the engine to make that object a Character.
The main reason of having different classes for static and dynamic objects is that static objects can be added to the light rendering cache along with floors and walls, whereas dynamic objects (characters) can't.
Don't use this class to implement bullets. Use the fBullet class.
YOU CAN'T CREATE INSTANCES OF THIS ELEMENT DIRECTLY.
Use scene.createCharacter() to add new characters to an scene.
See also
| Property | Defined by | ||
|---|---|---|---|
![]() | animated : Boolean = false
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
Retrieves controller from 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 | fObject | |
![]() | id : String
The string identifier of this element.
| fElement | |
| occlusion : Number = 100
This value goes from 0 to 100 and indicates the alpha strenght of the "hole" that is opened in planes that cover this character
"Cover" means literally, onscreen.
| fCharacter | ||
![]() | orientation : Number | fObject | |
![]() | radius : Number
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
Moves the element to a given position
| fElement | |
![]() |
show():void
Makes element visible
| fRenderableElement | |
![]() |
stopFollowing(target:fElement):void
Stops element from following another element
| fElement | |
|
teleportTo(x:Number, y:Number, z:Number):void
Moves a character into a new position, ignoring collisions
| fCharacter | ||
| Constant | Defined by | ||
|---|---|---|---|
| COLLIDE : String = "charactercollide" [static]
The fCharacter.COLLIDE constant defines the value of the
type property of the event object for a charactercollide event. | fCharacter | ||
| EVENT_IN : String = "charactereventin" [static]
The fCharacter.EVENT_IN constant defines the value of the
type property of the event object for a charactereventin event. | fCharacter | ||
| EVENT_OUT : String = "charactereventout" [static]
The fCharacter.EVENT_OUT constant defines the value of the
type property of the event object for a charactereventout event. | fCharacter | ||
![]() | 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 | |
| WALKOVER : String = "characterwalkover" [static]
The fCharacter.WALKOVER constant defines the value of the
type property of the event object for a characterwalkover event. | fCharacter | ||
| occlusion | property |
public var occlusion:Number = 100This value goes from 0 to 100 and indicates the alpha strenght of the "hole" that is opened in planes that cover this character "Cover" means literally, onscreen. This allows you to see what you are doing behind a wall. The default "100" value disables this effect
| teleportTo | () | method |
public function teleportTo(x:Number, y:Number, z:Number):voidMoves a character into a new position, ignoring collisions
Parametersx:Number — New x coordinate
|
|
y:Number — New y coordinate
|
|
z:Number — New z coordinate
|
| COLLIDE | constant |
public static const COLLIDE:String = "charactercollide"
The fCharacter.COLLIDE constant defines the value of the
type property of the event object for a charactercollide event.
The event is dispatched when the character collides with another element in the scene
| EVENT_IN | constant |
public static const EVENT_IN:String = "charactereventin"
The fCharacter.EVENT_IN constant defines the value of the
type property of the event object for a charactereventin event.
The event is dispatched when the character enters a cell where an event was defined
| EVENT_OUT | constant |
public static const EVENT_OUT:String = "charactereventout"
The fCharacter.EVENT_OUT constant defines the value of the
type property of the event object for a charactereventout event.
The event is dispatched when the character leaves a cell where an event was defined
| WALKOVER | constant |
public static const WALKOVER:String = "characterwalkover"
The fCharacter.WALKOVER constant defines the value of the
type property of the event object for a characterwalkover event.
The event is dispatched when the character walks over a non-solid object of the scene