QuickContacts
Kind of class: | public class |
---|---|
Package: | com.actionsnippet.qbox |
Inherits from: | b2ContactListener |
Implements: |
|
Version: | 1.1 |
Author: | Zevan Rosser |
Classpath: | com.actionsnippet.qbox.QuickContacts |
File last modified: | Saturday, 07 November 2009, 12:25:27 |
QuickContacts is responsible for dispatching all events related to Box2D contacts You should not instantiate this class directly. Instead, use QuickBox2D.addContactListener. It's worth noting that this class subclasses Box2D's b2ContactListner.
Events broadcasted to listeners:
- Event with type:
ADD
- dispatched whenever b2ContactPoint is created. - Event with type:
REMOVE
- dispatched whenever b2ContactPoint is removed. - Event with type:
PERSIST
- dispatched whenever b2ContactPoint persists. - Event with type:
RESULT
- dispatched whenever b2ContactPoint is solved.
Summary
Constructor
Constants
Instance properties
- currentPoint : b2ContactPoint
- The newest/current b2ContactPoint.
- currentResult : b2ContactResult
- The newest/current b2ContactResult.
Instance methods
- inCurrentContact (a:QuickObject) : Boolean
- Checks to see if a QuickObject is part of the current ADD, REMOVE or PERSIST event.
- isCurrentContact (a:QuickObject) : Boolean
- Checks to see if QuickObjects a and b are part of the current ADD, REMOVE or PERSIST event.
- addEventListener (type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false) : void
- dispatchEvent (evt:Event) : Boolean
- hasEventListener (type:String) : Boolean
- removeEventListener (type:String, listener:Function, useCapture:Boolean = false) : void
- willTrigger (type:String) : Boolean
Constructor
QuickContacts
public function QuickContacts (
)
Main description text.
Events broadcasted to listeners:
- Event with type:
ADD
- dispatched whenever b2ContactPoint is created. - Event with type:
REMOVE
- dispatched whenever b2ContactPoint is removed. - Event with type:
PERSIST
- dispatched whenever b2ContactPoint persists. - Event with type:
RESULT
- dispatched whenever b2ContactPoint is solved.
Constants
ADD
public static const ADD:String = "add"
(read)
For use with the ADD event.
PERSIST
public static const PERSIST:String = "persist"
(read)
For use with the PERSIST event.
REMOVE
public static const REMOVE:String = "remove"
(read)
For use with the REMOVE event.
RESULT
public static const RESULT:String = "result"
(read)
For use with the RESULT event.
Instance properties
currentPoint
public currentPoint:b2ContactPoint
(read,write)
The newest/current b2ContactPoint. You may want to read this when an ADD, REMOVE or PERSIST event occurs.
currentResult
public currentResult:b2ContactResult
(read,write)
The newest/current b2ContactResult. You may want to read this when a RESULT event occurs.
Instance methods
addEventListener
public function addEventListener (
type:String,
listener:Function,
useCapture:Boolean = false,
priority:int = 0,
useWeakReference:Boolean = false) : void
dispatchEvent
public function dispatchEvent (
evt:Event) : Boolean
hasEventListener
public function hasEventListener (
type:String) : Boolean
inCurrentContact
Checks to see if a QuickObject is part of the current ADD, REMOVE or PERSIST event. This should only be called within the listener function of any of these events.
isCurrentContact
Checks to see if QuickObjects
a
and b
are part of the current ADD, REMOVE or PERSIST event. This should only be called within the listener function of any of these events. removeEventListener
public function removeEventListener (
type:String,
listener:Function,
useCapture:Boolean = false) : void
willTrigger
public function willTrigger (
type:String) : Boolean