Package | away3d.extrusions |
Class | public class CollisionMap |
Inheritance | CollisionMap flash.events.EventDispatcher |
Property | Defined 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 |
Method | Defined 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 |
factorX | property |
factorX:Number
getter/setter for the factorX, factorY
public function get factorX():Number
public function set factorX(value:Number):void
factorY | property |
factorY:Number
public function get factorY():Number
public function set factorY(value:Number):void
offsetX | property |
offsetX:Number
getter/setter for the offsetX, offsetY
public function get offsetX():Number
public function set offsetX(value:Number):void
offsetY | property |
offsetY:Number
public function get offsetY():Number
public function set offsetY(value:Number):void
source | property |
source:BitmapData
getter/setter for source bitmapdata
public function get source():BitmapData
public function set source(value:BitmapData):void
CollisionMap | () | Constructor |
public function CollisionMap(sourcebmd:BitmapData, factorX:Number = 0, factorY:Number = 0)
Creates a new CollisionMap
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
|
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
|
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
|