Package | sekati.collisions |
Class | public class AbstractCollisionDetector |
Inheritance | AbstractCollisionDetector flash.events.EventDispatcher |
Subclasses | CollisionDetector, GroupCollisionDetector |
BitmapData
generated from the display objects ared used in the detection of
collisions & the collision angle which is calculated based on the display objects' shape
where the collision occurs.
See also
Property | Defined by | ||
---|---|---|---|
alphaThreshold : Number
A floating point value from
0 - 1 that determines the minimum alpha value to check for collisions. | AbstractCollisionDetector | ||
isMonitoring : Boolean [read-only]
Whether the frame-base collision monitor is running.
| AbstractCollisionDetector | ||
numChildren : uint [read-only]
The number of
DisplayObject s being checked for collision. | AbstractCollisionDetector | ||
returnAngleType : String
Determines if the angle returned from a collision is in
CollisionAngle.RADIAN or
CollisionAngle.DEGREE_ANGLE_TYPE (Default: CollisionAngle.NONE ). | AbstractCollisionDetector |
Property | Defined by | ||
---|---|---|---|
objectArray : TypedArray | AbstractCollisionDetector | ||
objectCheckArray : TypedArray | AbstractCollisionDetector | ||
objectCollisionArray : TypedArray | AbstractCollisionDetector |
Method | Defined by | ||
---|---|---|---|
AbstractCollisionDetector Constructor
| AbstractCollisionDetector | ||
addItem(obj:DisplayObject):void
Add a
DisplayObject to the list of objects to check for collisions. | AbstractCollisionDetector | ||
Stub function for subclasses which checks for collisions and returns a
Collision TypedArray
containing all Collision 's. | AbstractCollisionDetector | ||
excludeColor(color32:uint, alphaRange:uint = 255, redRange:uint = 20, greenRange:uint = 20, blueRange:uint = 20):void
Defines a color or color range to exclude from collision detections.
| AbstractCollisionDetector | ||
removeExcludeColor(color32:uint):void
Removes the color specified from the list of colors to exclude from collision detections.
| AbstractCollisionDetector | ||
removeItem(obj:DisplayObject):void
Remove a
DisplayObject from the list of objects to check for collisions. | AbstractCollisionDetector | ||
startMonitor():void
Start frame-based automatic collision monitoring.
| AbstractCollisionDetector | ||
stopMonitor():void
Stop frame-based automatic collision monitoring.
| AbstractCollisionDetector |
Method | Defined by | ||
---|---|---|---|
clearArrays():void
Clear the
objectCheckArray and objectCollisionArray . | AbstractCollisionDetector | ||
monitor(e:Event):void
Frame-based collision monitoring dispatches
CollisionEvent 's
when one or more collisions are detected. | AbstractCollisionDetector |
alphaThreshold | property |
alphaThreshold:Number
[read-write]
A floating point value from 0 - 1
that determines the minimum alpha value to check for collisions.
public function get alphaThreshold():Number
public function set alphaThreshold(value:Number):void
isMonitoring | property |
isMonitoring:Boolean
[read-only]Whether the frame-base collision monitor is running.
Implementation public function get isMonitoring():Boolean
numChildren | property |
numChildren:uint
[read-only]
The number of DisplayObject
s being checked for collision.
public function get numChildren():uint
objectArray | property |
protected var objectArray:TypedArray
objectCheckArray | property |
protected var objectCheckArray:TypedArray
objectCollisionArray | property |
protected var objectCollisionArray:TypedArray
returnAngleType | property |
returnAngleType:String
[read-write]
Determines if the angle returned from a collision is in CollisionAngle.RADIAN
or
CollisionAngle.DEGREE_ANGLE_TYPE
(Default: CollisionAngle.NONE
).
public function get returnAngleType():String
public function set returnAngleType(value:String):void
AbstractCollisionDetector | () | constructor |
public function AbstractCollisionDetector()
AbstractCollisionDetector Constructor
addItem | () | method |
public function addItem(obj:DisplayObject):void
Add a DisplayObject
to the list of objects to check for collisions.
obj:DisplayObject |
checkCollisions | () | method |
public function checkCollisions():TypedArray
Stub function for subclasses which checks for collisions and returns a Collision TypedArray
containing all Collision
's.
TypedArray |
clearArrays | () | method |
protected function clearArrays():void
Clear the objectCheckArray
and objectCollisionArray
.
excludeColor | () | method |
public function excludeColor(color32:uint, alphaRange:uint = 255, redRange:uint = 20, greenRange:uint = 20, blueRange:uint = 20):void
Defines a color or color range to exclude from collision detections. The excludeColor() method expects a 32 bit color value. Optional ranges based on this color can be specified for all channels using the additional parameters. Each range accepts integral values from 0 to 255, accounting for all values for each color channel. The ranges move in both directions at the amount specified for each channel.
Parameterscolor32:uint — The color to exclude. Must be a 32 bit value (E.g. 0xFFFFFFFF ).
|
|
alphaRange:uint (default = 255 ) — The integral range of alpha values to exclude, based on the color's alpha value. Valid values are 0 - 255.
|
|
redRange:uint (default = 20 ) — The integral range of red values to exclude, based on the color's red value. Valid values are 0 - 255
|
|
greenRange:uint (default = 20 ) — The integral range of green values to exclude, based on the color's green value. Valid values are 0 - 255
|
|
blueRange:uint (default = 20 ) — The integral range of blue values to exclude, based on the color's blue value. Valid values are 0 - 255
|
See also
monitor | () | method |
protected function monitor(e:Event):void
Frame-based collision monitoring dispatches CollisionEvent
's
when one or more collisions are detected.
You must explicitly call startMonitor()
or stopMonitor()
to
begin/end monitoring. The status may be checked via isMonitoring
e:Event |
removeExcludeColor | () | method |
public function removeExcludeColor(color32:uint):void
Removes the color specified from the list of colors to exclude from collision detections. Must be a color previously added
using the excludeColor()
method. Expects a 32 bit color value.
color32:uint — The color to exclude. Must be a 32 bit value (E.g. 0xFFFFFFFF ).
|
See also
removeItem | () | method |
public function removeItem(obj:DisplayObject):void
Remove a DisplayObject
from the list of objects to check for collisions.
obj:DisplayObject |
startMonitor | () | method |
public function startMonitor():void
Start frame-based automatic collision monitoring.
stopMonitor | () | method |
public function stopMonitor():void
Stop frame-based automatic collision monitoring.