Packageorg.ffilmation.engine.core
Classpublic class fScene
InheritancefScene Inheritance 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.



Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
  
Removes a character from the scene.
fScene
  
Removes an omni light from the scene.
fScene
  
setCamera(camera:fCamera):void
This method sets the active camera for this scene.
fScene
Public Constants
 ConstantDefined 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
Property detail
AIproperty
public var AI:fAiContainer

The AI-related method are grouped inside this object, for easier access

allproperty 
public var all:Array

An array of all elements in this scene, use it with ID Strings

charactersproperty 
public var characters:Array

An array of all characters for fast loop access. For "id" access use the .all array

containerproperty 
public var container:Sprite

Were scene is drawn

depthproperty 
public var depth:Number

Scene depth in pixels

environmentLightproperty 
public var environmentLight:fGlobalLight

The global light for this scene. Use this property to change light properties such as intensity and color

floorsproperty 
public var floors:Array

An array of all floors for fast loop access. For "id" access use the .all array

idproperty 
public var id:String
lightsproperty 
public var lights:Array

An array of all lights for fast loop access. For "id" access use the .all array

objectsproperty 
public var objects:Array

An array of all objects for fast loop access. For "id" access use the .all array

readyproperty 
public var ready:Boolean

Indicates if the scene is loaded and ready

statproperty 
public var stat:String

An string indicating the scene's current status

wallsproperty 
public var walls:Array

An array of all walls for fast loop access. For "id" access use the .all array

widthproperty 
public var width:Number

Scene width in pixels.

Constructor detail
fScene()constructor
public function fScene(engine:fEngine, container:Sprite, retriever:fEngineSceneRetriever, width:Number, height:Number)

Constructor. Don't call directly, use fEngine.createScene() instead

Parameters
engine:fEngine
 
container:Sprite
 
retriever:fEngineSceneRetriever
 
width:Number
 
height:Number
Method detail
createCamera()method
public function createCamera():fCamera

Creates a new camera associated to the scene

Returns
fCamera — 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):fCharacter

Creates a new character an adds it to the scene

Parameters
idchar: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

Returns
fCharacter
createOmniLight()method 
public function 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. You won't see the light until you call its render() or moveTo() methods

Parameters
idlight: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

Returns
fOmniLight
removeCharacter()method 
public function removeCharacter(char:fCharacter):void

Removes a character from the scene. This is not the same as hiding the character, this removes the element completely from the scene

Parameters
char:fCharacter — The character to be removed
removeOmniLight()method 
public function removeOmniLight(light:fOmniLight):void

Removes an omni light from the scene. This is not the same as hiding the light, this removes the element completely from the scene

Parameters
light:fOmniLight — The light to be removed
setCamera()method 
public function setCamera(camera:fCamera):void

This method sets the active camera for this scene. The camera position determines the viewable area of the scene

Parameters
camera:fCamera — The camera you want to be active
Constant detail
LOADCOMPLETEconstant
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

LOADPROGRESSconstant 
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