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

Public Properties
 PropertyDefined by
  factorX : Number
CollisionMap
  factorY : Number
CollisionMap
  offsetX : Number
CollisionMap
  offsetY : Number
CollisionMap
  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  [read-write]Implementation
    public function get factorX():Number
    public function set factorX(value:Number):void
factorYproperty 
factorY:Number  [read-write]Implementation
    public function get factorY():Number
    public function set factorY(value:Number):void
offsetXproperty 
offsetX:Number  [read-write]Implementation
    public function get offsetX():Number
    public function set offsetX(value:Number):void
offsetYproperty 
offsetY:Number  [read-write]Implementation
    public function get offsetY():Number
    public function set offsetY(value:Number):void
sourceproperty 
source:BitmapData  [read-write]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)Parameters
sourcebmd:BitmapData — sourcebmd The bitmapdata with color regions to act as trigger.
 
factorX:Number (default = 0) — factorX [optional] A factor scale along the X axis
 
factorY:Number (default = 0) — factorY [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 Parameters
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 X coordinate on the source bmd
 
y:Number — y 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 X coordinate on the source bmd
 
y:Number — y 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 — color A color Number
 
eventid:String — eventid A string to identify that event
 
listener:Function — listener The function that must be triggered note that offsetX, offsetY, factorX, factorY are applied in this handler
Wiki link
Click to go to the wiki page for 'away3d.extrusions.CollisionMap'

Code examples

Comments