factorX:Number
[read-write]Implementation
public function get factorX():Number
public function set factorX(value:Number):void
factorY:Number
[read-write]Implementation
public function get factorY():Number
public function set factorY(value:Number):void
offsetX:Number
[read-write]Implementation
public function get offsetX():Number
public function set offsetX(value:Number):void
offsetY:Number
[read-write]Implementation
public function get offsetY():Number
public function set offsetY(value:Number):void
source:BitmapData
[read-write]Implementation
public function get source():BitmapData
public function set source(value:BitmapData):void
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
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
|
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
|
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
|