Packageorg.ffilmation.engine.interfaces
Interfacepublic interface fEngineMaterial

This interface defines methods that any class that is to be used as a material in the engine must implement



Public Methods
 MethodDefined by
  
fEngineMaterial(definition:fMaterialDefinition)
Constructor
fEngineMaterial
  
dispose():void
Frees all allocated resources for this material.
fEngineMaterial
  
getBump(element:fRenderableElement, width:Number, height:Number):DisplayObject
Retrieves the bump map for this material.
fEngineMaterial
  
getContours(element:fRenderableElement, width:Number, height:Number):Array
Retrieves an array of contours that define the shape of this material.
fEngineMaterial
  
getDiffuse(element:fRenderableElement, width:Number, height:Number):DisplayObject
Retrieves the diffuse map for this material.
fEngineMaterial
  
getHoleBlock(element:fRenderableElement, index:Number):MovieClip
Retrieves the graphic element that is to be used to block a given hole when it is closed
fEngineMaterial
  
getHoles(element:fRenderableElement, width:Number, height:Number):Array
Retrieves an array of holes (if any) of this material.
fEngineMaterial
Method detail
dispose()method
public function dispose():void

Frees all allocated resources for this material. It is called when the scene is destroyed and we want to free as much RAM as possible

getBump()method 
public function getBump(element:fRenderableElement, width:Number, height:Number):DisplayObject

Retrieves the bump map for this material. If you write custom classes, make sure they return the proper size 0,0 of the returned DisplayObject corresponds to the top-left corner of material

Parameters
element:fRenderableElement — The element( wall or floor ) where this map will be applied
 
width:Number — Requested width
 
height:Number — Requested height

Returns
DisplayObject — A DisplayObject (either Bitmap or MovieClip) that will used as BumpMap. If it is a MovieClip, the first frame will we used
getContours()method 
public function getContours(element:fRenderableElement, width:Number, height:Number):Array

Retrieves an array of contours that define the shape of this material. Every contours is an Array of Points

Parameters
element:fRenderableElement — The element( wall or floor ) where the holes will be applied
 
width:Number — Requested width
 
height:Number — Requested height

Returns
Array — An array of arrays of points, one for each contour. Positions and sizes are relative to material origin of coordinates
getDiffuse()method 
public function getDiffuse(element:fRenderableElement, width:Number, height:Number):DisplayObject

Retrieves the diffuse map for this material. If you write custom classes, make sure they return the proper size. 0,0 of the returned DisplayObject corresponds to the top-left corner of material

Parameters
element:fRenderableElement — The element( wall or floor ) where this map will be applied
 
width:Number — Requested width
 
height:Number — Requested width

Returns
DisplayObject — A DisplayObject (either Bitmap or MovieClip) that will be display onscreen
getHoleBlock()method 
public function getHoleBlock(element:fRenderableElement, index:Number):MovieClip

Retrieves the graphic element that is to be used to block a given hole when it is closed

Parameters
element:fRenderableElement — The element( wall or floor ) where the block will be applied
 
index:Number — The hole index, as returned by the getHoles() method

Returns
MovieClip — A MovieClip that will used to close the hole. If null is returned, the hole won't be "closeable".
getHoles()method 
public function getHoles(element:fRenderableElement, width:Number, height:Number):Array

Retrieves an array of holes (if any) of this material. These holes will be used to render proper lights and calculate collisions and bullet impacts

Parameters
element:fRenderableElement — The element( wall or floor ) where the holes will be applied
 
width:Number — Requested width
 
height:Number — Requested height

Returns
Array — An array of Rectangle objects, one for each hole. Positions and sizes are relative to material origin of coordinates