Packageaway3d.extrusions
Classpublic class CollisionMap
InheritanceCollisionMap Inheritance flash.events.EventDispatcher



Public Properties
 PropertyDefined By
  factorX : Number
getter/setter for the factorX, factorY
CollisionMap
  factorY : Number
CollisionMap
  offsetX : Number
getter/setter for the offsetX, offsetY
CollisionMap
  offsetY : Number
CollisionMap
  source : BitmapData
getter/setter for source bitmapdata
CollisionMap
Public Methods
 MethodDefined By
  
CollisionMap(sourcebmd:BitmapData, factorX:Number = 0, factorY:Number = 0)
Creates a new CollisionMap
CollisionMap
  
getColorAt(x:Number, y:Number):Number
If at the given coordinates a color is found that matches a defined color event, the color event will be triggered.
CollisionMap
  
read(x:Number, y:Number):void
If at the given coordinates a color is found that matches a defined color event, the color event will be triggered.
CollisionMap
  
setColorEvent(color:Number, eventid:String, listener:Function):void
Defines a color event for this class
CollisionMap
Property Detail
factorXproperty
factorX:Number

getter/setter for the factorX, factorY


Implementation
    public function get factorX():Number
    public function set factorX(value:Number):void
factorYproperty 
factorY:Number


Implementation
    public function get factorY():Number
    public function set factorY(value:Number):void
offsetXproperty 
offsetX:Number

getter/setter for the offsetX, offsetY


Implementation
    public function get offsetX():Number
    public function set offsetX(value:Number):void
offsetYproperty 
offsetY:Number


Implementation
    public function get offsetY():Number
    public function set offsetY(value:Number):void
sourceproperty 
source:BitmapData

getter/setter for source bitmapdata


Implementation
    public function get source():BitmapData
    public function set source(value:BitmapData):void
Constructor Detail
CollisionMap()Constructor
public function CollisionMap(sourcebmd:BitmapData, factorX:Number = 0, factorY:Number = 0)

Creates a new CollisionMap

Parameters
sourcebmd:BitmapData — The bitmapdata with color regions to act as trigger.
 
factorX:Number (default = 0) — [optional] A factor scale along the X axis
 
factorY:Number (default = 0) — [optional] A factor scale along the Y axis note that an offset equal to halfwidth/halfheight of the source is set per default. Because most terrains are placed centered at 0,0,0
####INIT####
Method Detail
getColorAt()method
public function getColorAt(x:Number, y:Number):Number

If at the given coordinates a color is found that matches a defined color event, the color event will be triggered.

Parameters

x:Number — X coordinate on the source bmd
 
y:Number — Y coordinate on the source bmd

Returns
Number — A Number, the color value at coordinates x, y note that offsetX, offsetY, factorX, factorY are applied in this handler
read()method 
public function read(x:Number, y:Number):void

If at the given coordinates a color is found that matches a defined color event, the color event will be triggered.

Parameters

x:Number — X coordinate on the source bmd
 
y:Number — Y coordinate on the source bmd note that offsetX, offsetY, factorX, factorY are applied in this handler

setColorEvent()method 
public function setColorEvent(color:Number, eventid:String, listener:Function):void

Defines a color event for this class

Parameters

color:Number — A color Number
 
eventid:String — A string to identify that event
 
listener:Function — The function that must be triggered note that offsetX, offsetY, factorX, factorY are applied in this handler