Packageorg.ffilmation.engine.interfaces
Interfacepublic interface fEngineRenderEngine

If you don't plan to write a custom renderer for the engine, you don't need to know any of these.
This interface defines methods that any class that is to be used as a render engine need to implement.



Public Methods
 MethodDefined by
  
fEngineRenderEngine(scene:fScene, container:Sprite)
Class constructor
fEngineRenderEngine
  
This method disables mouse events for an element
fEngineRenderEngine
  
dispose():void
Frees all allocated resources.
fEngineRenderEngine
  
This method enables mouse events for an element
fEngineRenderEngine
  
getAssetFor(element:fRenderableElement):MovieClip
This method returns the asset from the library that was used to display the element.
fEngineRenderEngine
  
This method renders an element invisible
fEngineRenderEngine
  
initialize():void
This method is called when the scene is to be displayed.
fEngineRenderEngine
  
This method initializes the render engine for an element in the scene.
fEngineRenderEngine
  
lightIn(element:fRenderableElement, light:fOmniLight):void
When a moving light reaches an element, this method is executed
fEngineRenderEngine
  
lightOut(element:fRenderableElement, light:fOmniLight):void
When a moving light moves out of an element, this method is executed
fEngineRenderEngine
  
When a light is to be reset ( new size )
fEngineRenderEngine
  
When an element is removed or hidden, or moves out of another element's range, its shadows need to be removed too
fEngineRenderEngine
  

Rendering occurs in two ways: a light changes or an element changes.

fEngineRenderEngine
  

Rendering occurs in two ways: a light changes or an element changes.

fEngineRenderEngine
  

Rendering occurs in two ways: a light changes or an element changes.

fEngineRenderEngine
  

Rendering occurs in two ways: a light changes or an element changes.

fEngineRenderEngine
  
resetShadows():void
When the quality settings for the engine's shadows are changed, this method is called so old shadows are removed.
fEngineRenderEngine
  
Updates the render to show a given camera's position
fEngineRenderEngine
  
setViewportSize(width:Number, height:Number):void
Updates the viewport size.
fEngineRenderEngine
  
This method renders an element visible
fEngineRenderEngine
  
startOcclusion(element:fRenderableElement, character:fCharacter):void
Starts acclusion related to one character
fEngineRenderEngine
  
stopOcclusion(element:fRenderableElement, character:fCharacter):void
Stops acclusion related to one character
fEngineRenderEngine
  
This method removes an element from the render engine
fEngineRenderEngine
  
translateStageCoordsToElements(x:Number, y:Number):Array
This method returns the element under a Stage coordinate, and a 3D translation of the 2D coordinates passed as input.
fEngineRenderEngine
  
This method updates the position of a bullet's sprite
fEngineRenderEngine
  
This method updates the position of a character's sprite
fEngineRenderEngine
  
Updates acclusion related to one character
fEngineRenderEngine
  

Rendering occurs in two ways: a light changes or an element changes.

fEngineRenderEngine
Method detail
disableElement()method
public function disableElement(element:fRenderableElement):void

This method disables mouse events for an element

Parameters
element:fRenderableElement — The element we want to hide
dispose()method 
public function dispose():void

Frees all allocated resources. This is called when the scene is hidden or destroyed.

enableElement()method 
public function enableElement(element:fRenderableElement):void

This method enables mouse events for an element

Parameters
element:fRenderableElement — The element we want to show
getAssetFor()method 
public function getAssetFor(element:fRenderableElement):MovieClip

This method returns the asset from the library that was used to display the element. It gets written as the "flashClip" property of the element.

Parameters
element:fRenderableElement — The element for which we want the asset

Returns
MovieClip — The flashClip that represents the element. It is not the same as the container. The flashClip is nested somewhere inside the container

See also

hideElement()method 
public function hideElement(element:fRenderableElement):void

This method renders an element invisible

Parameters
element:fRenderableElement — The element we want to hide
initialize()method 
public function initialize():void

This method is called when the scene is to be displayed.

initRenderFor()method 
public function initRenderFor(element:fRenderableElement):fElementContainer

This method initializes the render engine for an element in the scene.

Parameters
element:fRenderableElement — The element we want to initialize

Returns
fElementContainer — The container where the render for the element is displayed. This gets written as the "container" property of the element.

See also

lightIn()method 
public function lightIn(element:fRenderableElement, light:fOmniLight):void

When a moving light reaches an element, this method is executed

Parameters
element:fRenderableElement — The element that has become affected by the light
 
light:fOmniLight — The light that we are rendering upon this element
lightOut()method 
public function lightOut(element:fRenderableElement, light:fOmniLight):void

When a moving light moves out of an element, this method is executed

Parameters
element:fRenderableElement — The element that is no longer affected by the light
 
light:fOmniLight — The light
lightReset()method 
public function lightReset(element:fRenderableElement, light:fOmniLight):void

When a light is to be reset ( new size )

Parameters
element:fRenderableElement — The element
 
light:fOmniLight — The light
removeShadow()method 
public function removeShadow(element:fRenderableElement, light:fOmniLight, shadow:fRenderableElement):void

When an element is removed or hidden, or moves out of another element's range, its shadows need to be removed too

Parameters
element:fRenderableElement — The element to be updated
 
light:fOmniLight — The light that we are rendering upon this element
 
shadow:fRenderableElement — The element whose shadow is to be removed
renderFinish()method 
public function renderFinish(element:fRenderableElement, light:fOmniLight):void

Rendering occurs in two ways: a light changes or an element changes. When a light changes this happens:

  1. A renderStart call is issued for each affected element.
  2. Each affected element receives a renderLight call, and if any is needed several renderShadow calls.
  3. A renderFinish call is issued for each affected element.

This is the renderFinish call.

Parameters
element:fRenderableElement — The element we are rendering
 
light:fOmniLight — The light that we are rendering upon this element
renderLight()method 
public function renderLight(element:fRenderableElement, light:fOmniLight):void

Rendering occurs in two ways: a light changes or an element changes. When a light changes this happens:

  1. A renderStart call is issued for each affected element.
  2. Each affected element receives a renderLight call, and if any is needed several renderShadow calls.
  3. A renderFinish call is issued for each affected element.

This is the renderLight call.

Parameters
element:fRenderableElement — The element we are rendering
 
light:fOmniLight — The light that we are rendering upon this element
renderShadow()method 
public function renderShadow(element:fRenderableElement, light:fOmniLight, shadow:fRenderableElement):void

Rendering occurs in two ways: a light changes or an element changes. When a light changes this happens:

  1. A renderStart call is issued for each affected element.
  2. Each affected element receives a renderLight call, and if any is needed several renderShadow calls.
  3. A renderFinish call is issued for each affected element.

This is the renderShadow call.

Parameters
element:fRenderableElement — The element we are rendering
 
light:fOmniLight — The light that we are rendering upon this element
 
shadow:fRenderableElement — The element whose shadow we are drawing
renderStart()method 
public function renderStart(element:fRenderableElement, light:fOmniLight):void

Rendering occurs in two ways: a light changes or an element changes. When a light changes this happens:

  1. A renderStart call is issued for each affected element.
  2. Each affected element receives a renderLight call, and if any is needed several renderShadow calls.
  3. A renderFinish call is issued for each affected element.

This is the renderStart call.

Parameters
element:fRenderableElement — The element in the scene we want to start rendering
 
light:fOmniLight — The light that we are rendering upon this element
resetShadows()method 
public function resetShadows():void

When the quality settings for the engine's shadows are changed, this method is called so old shadows are removed. There is no need for the renderer to redraw all shadows in this method: The engine rerenders the whole scene after this has been executed.

setCameraPosition()method 
public function setCameraPosition(camera:fCamera):void

Updates the render to show a given camera's position

Parameters
camera:fCamera
setViewportSize()method 
public function setViewportSize(width:Number, height:Number):void

Updates the viewport size. This call will be immediately followed by a setCameraPosition call

Parameters
width:Number
 
height:Number

See also

org.ffilmation.engine.interfaces.fRenderEngine.setCameraPosition
showElement()method 
public function showElement(element:fRenderableElement):void

This method renders an element visible

Parameters
element:fRenderableElement — The element we want to show
startOcclusion()method 
public function startOcclusion(element:fRenderableElement, character:fCharacter):void

Starts acclusion related to one character

Parameters
element:fRenderableElement — Element where occlusion is applied
 
character:fCharacter — Character causing the occlusion
stopOcclusion()method 
public function stopOcclusion(element:fRenderableElement, character:fCharacter):void

Stops acclusion related to one character

Parameters
element:fRenderableElement — Element where occlusion is applied
 
character:fCharacter — Character causing the occlusion
stopRenderFor()method 
public function stopRenderFor(element:fRenderableElement):void

This method removes an element from the render engine

Parameters
element:fRenderableElement — The element we want to remove

See also

translateStageCoordsToElements()method 
public function translateStageCoordsToElements(x:Number, y:Number):Array

This method returns the element under a Stage coordinate, and a 3D translation of the 2D coordinates passed as input. To achieve this it finds which visible elements are under the input pixel, ignoring the engine's internal coordinates. Now you can find out what did you click and which point of that element did you click.

Parameters
x:Number — Stage horizontal coordinate
 
y:Number — Stage vertical coordinate

Returns
Array — An array of objects storing both the element under that point and a 3d coordinate corresponding to the 2d Point. This method returns null if the coordinate is not occupied by any element. Why an Array an not a single element ? Because you may want to search the Array for the element that better suits your intentions: for example if you use it to walk around the scene, you will want to ignore trees to reach the floor behind. If you are shooting people, you will want to ignore floors and look for objects and characters to target at.

See also

updateBulletPosition()method 
public function updateBulletPosition(bullet:fBullet):void

This method updates the position of a bullet's sprite

Parameters
bullet:fBullet — The bullet that needs to be moved
updateCharacterPosition()method 
public function updateCharacterPosition(char:fCharacter):void

This method updates the position of a character's sprite

Parameters
char:fCharacter — The character that needs to be moved
updateOcclusion()method 
public function updateOcclusion(element:fRenderableElement, character:fCharacter):void

Updates acclusion related to one character

Parameters
element:fRenderableElement — Element where occlusion is applied
 
character:fCharacter — Character causing the occlusion
updateShadow()method 
public function updateShadow(element:fRenderableElement, light:fOmniLight, shadow:fRenderableElement):void

Rendering occurs in two ways: a light changes or an element changes. When an element changes this happens:

  1. A renderStart call is issued for the updated element.
  2. The element receives a renderLight call, and if any is needed several renderShadow calls.
  3. A renderFinish call is issued for the affected element.
  4. All elements that receive shadows from the moving element receive an updateShadow call.

This is the updateShadow call.

Parameters
element:fRenderableElement — The element to be updated
 
light:fOmniLight — The light that we are rendering upon this element
 
shadow:fRenderableElement — The element whose shadow is to be updated