| Package | org.ffilmation.engine.core |
| Class | public class fScene |
| Inheritance | fScene flash.events.EventDispatcher |
The fScene class provides control over a scene in your application. The API for this object is used to add and remove elements from the scene after it has been loaded, and managing cameras.
Moreover, you can get information on topology, visibility from one point to another, search for paths and other useful methods that will help, for example, in programming AIs that move inside the scene.
| Property | Defined by | ||
|---|---|---|---|
| AI : fAiContainer
The AI-related method are grouped inside this object, for easier access
| fScene | ||
| all : Array
An array of all elements in this scene, use it with ID Strings
| fScene | ||
| characters : Array
An array of all characters for fast loop access.
| fScene | ||
| container : Sprite
Were scene is drawn
| fScene | ||
| depth : Number
Scene depth in pixels
| fScene | ||
| environmentLight : fGlobalLight
The global light for this scene.
| fScene | ||
| floors : Array
An array of all floors for fast loop access.
| fScene | ||
| id : String | fScene | ||
| lights : Array
An array of all lights for fast loop access.
| fScene | ||
| objects : Array
An array of all objects for fast loop access.
| fScene | ||
| ready : Boolean
Indicates if the scene is loaded and ready
| fScene | ||
| stat : String
An string indicating the scene's current status
| fScene | ||
| walls : Array
An array of all walls for fast loop access.
| fScene | ||
| width : Number
Scene width in pixels.
| fScene | ||
| Method | Defined by | ||
|---|---|---|---|
|
fScene(engine:fEngine, container:Sprite, retriever:fEngineSceneRetriever, width:Number, height:Number)
Constructor.
| fScene | ||
|
Creates a new camera associated to the scene
| fScene | ||
|
createCharacter(idchar:String, def:String, x:Number, y:Number, z:Number):fCharacter
Creates a new character an adds it to the scene
| fScene | ||
|
createOmniLight(idlight:String, x:Number, y:Number, z:Number, size:Number, color:String, intensity:Number, decay:Number, bumpMapped:Boolean):fOmniLight
Creates a new light and adds it to the scene.
| fScene | ||
|
removeCharacter(char:fCharacter):void
Removes a character from the scene.
| fScene | ||
|
removeOmniLight(light:fOmniLight):void
Removes an omni light from the scene.
| fScene | ||
|
This method sets the active camera for this scene.
| fScene | ||
| Constant | Defined by | ||
|---|---|---|---|
| LOADCOMPLETE : String = "sceneloadcomplete" [static]
The fScene.LOADCOMPLETE constant defines the value of the
type property of the event object for a sceneloadcomplete event. | fScene | ||
| LOADPROGRESS : String = "scenecloadprogress" [static]
The fScene.LOADPROGRESS constant defines the value of the
type property of the event object for a scenecloadprogress event. | fScene | ||
| AI | property |
public var AI:fAiContainerThe AI-related method are grouped inside this object, for easier access
| all | property |
public var all:ArrayAn array of all elements in this scene, use it with ID Strings
| characters | property |
public var characters:ArrayAn array of all characters for fast loop access. For "id" access use the .all array
| container | property |
public var container:SpriteWere scene is drawn
| depth | property |
public var depth:NumberScene depth in pixels
| environmentLight | property |
public var environmentLight:fGlobalLightThe global light for this scene. Use this property to change light properties such as intensity and color
| floors | property |
public var floors:ArrayAn array of all floors for fast loop access. For "id" access use the .all array
| id | property |
public var id:String
| lights | property |
public var lights:ArrayAn array of all lights for fast loop access. For "id" access use the .all array
| objects | property |
public var objects:ArrayAn array of all objects for fast loop access. For "id" access use the .all array
| ready | property |
public var ready:BooleanIndicates if the scene is loaded and ready
| stat | property |
public var stat:StringAn string indicating the scene's current status
| walls | property |
public var walls:ArrayAn array of all walls for fast loop access. For "id" access use the .all array
| width | property |
public var width:NumberScene width in pixels.
| fScene | () | constructor |
public function fScene(engine:fEngine, container:Sprite, retriever:fEngineSceneRetriever, width:Number, height:Number)Constructor. Don't call directly, use fEngine.createScene() instead
Parametersengine:fEngine |
|
container:Sprite |
|
retriever:fEngineSceneRetriever |
|
width:Number |
|
height:Number |
| createCamera | () | method |
public function createCamera():fCameraCreates a new camera associated to the scene
ReturnsfCamera —
an fCamera object ready to move or make active using the setCamera() method
|
| createCharacter | () | method |
public function createCharacter(idchar:String, def:String, x:Number, y:Number, z:Number):fCharacterCreates a new character an adds it to the scene
Parametersidchar:String — The unique id that will identify the character
|
|
def:String — Definition id. Must match a definition in some of the definition XMLS included in the scene
|
|
x:Number — Initial x coordinate for the character
|
|
y:Number — Initial x coordinate for the character
|
|
z:Number — Initial x coordinate for the character
|
fCharacter |
| createOmniLight | () | method |
public function createOmniLight(idlight:String, x:Number, y:Number, z:Number, size:Number, color:String, intensity:Number, decay:Number, bumpMapped:Boolean):fOmniLightCreates a new light and adds it to the scene. You won't see the light until you call its render() or moveTo() methods
Parametersidlight:String — The unique id that will identify the light
|
|
x:Number — Initial x coordinate for the light
|
|
y:Number — Initial x coordinate for the light
|
|
z:Number — Initial x coordinate for the light
|
|
size:Number — Radius of the sphere that identifies the light
|
|
color:String — An string specifying the color of the light in HTML format, example: #ffeedd
|
|
intensity:Number — Intensity of the light goes from 0 to 100
|
|
decay:Number — From 0 to 100 marks the distance along the lights's radius from where intensity starrts to fade fades. A 0 decay defines a solid light
|
|
bumpMapped:Boolean — Determines if this light will be rendered with bumpmapping. Please note that for the bumpMapping to work in a given surface,
the surface will need a bumpMap definition and bumpMapping must be enabled in the engine's global parameters
|
fOmniLight |
| removeCharacter | () | method |
public function removeCharacter(char:fCharacter):voidRemoves a character from the scene. This is not the same as hiding the character, this removes the element completely from the scene
Parameterschar:fCharacter — The character to be removed
|
| removeOmniLight | () | method |
public function removeOmniLight(light:fOmniLight):voidRemoves an omni light from the scene. This is not the same as hiding the light, this removes the element completely from the scene
Parameterslight:fOmniLight — The light to be removed
|
| setCamera | () | method |
public function setCamera(camera:fCamera):voidThis method sets the active camera for this scene. The camera position determines the viewable area of the scene
Parameterscamera:fCamera — The camera you want to be active
|
| LOADCOMPLETE | constant |
public static const LOADCOMPLETE:String = "sceneloadcomplete"
The fScene.LOADCOMPLETE constant defines the value of the
type property of the event object for a sceneloadcomplete event.
The event is dispatched when the scene finishes loading and processing and is ready to be used
| LOADPROGRESS | constant |
public static const LOADPROGRESS:String = "scenecloadprogress"
The fScene.LOADPROGRESS constant defines the value of the
type property of the event object for a scenecloadprogress event.
The event is dispatched when the status of the scene changes during scene loading and processing.
A listener to this event can then check the scene's status property to update a progress dialog