| Package | org.flintparticles.twoD.zones |
| Class | public class DisplayObjectZone |
| Inheritance | DisplayObjectZone Object |
| Implements | Zone2D |
| Property | Defined By | ||
|---|---|---|---|
| displayObject : DisplayObject
The DisplayObject that defines the zone. | DisplayObjectZone | ||
| renderer : DisplayObject
The emitter that you plan to use the zone with. | DisplayObjectZone | ||
| Method | Defined By | ||
|---|---|---|---|
DisplayObjectZone(displayObject:DisplayObject = null, renderer:DisplayObject = null)
The constructor creates a DisplayObjectZone object. | DisplayObjectZone | ||
collideParticle(particle:Particle2D, bounce:Number = 1):Boolean
Manages collisions between a particle and the zone. | DisplayObjectZone | ||
contains(x:Number, y:Number):Boolean
The contains method determines whether a point is inside the zone. | DisplayObjectZone | ||
getArea():Number
The getArea method returns the size of the zone. | DisplayObjectZone | ||
getLocation():Point
The getLocation method returns a random point inside the zone. | DisplayObjectZone | ||
| displayObject | property |
displayObject:DisplayObjectThe DisplayObject that defines the zone.
public function get displayObject():DisplayObject public function set displayObject(value:DisplayObject):void| renderer | property |
renderer:DisplayObjectThe emitter that you plan to use the zone with. The coordinates of the DisplayObject are translated to the local coordinate space of the emitter.
public function get renderer():DisplayObject public function set renderer(value:DisplayObject):void| DisplayObjectZone | () | Constructor |
public function DisplayObjectZone(displayObject:DisplayObject = null, renderer:DisplayObject = null)The constructor creates a DisplayObjectZone object.
ParametersdisplayObject:DisplayObject (default = null) — The DisplayObject that defines the zone.
| |
renderer:DisplayObject (default = null) — The renderer that you plan to use the zone with. The
coordinates of the DisplayObject are translated to the local coordinate
space of the renderer.
|
| collideParticle | () | method |
public function collideParticle(particle:Particle2D, bounce:Number = 1):BooleanManages collisions between a particle and the zone. The particle will collide with the edges of the zone, from the inside or outside. In the interests of speed, these collisions do not take account of the collisionRadius of the particle and they do not calculate an accurate bounce direction from the shape of the zone. Priority is placed on keeping particles inside or outside the zone.
Parameters
particle:Particle2D — The particle to be tested for collision with the zone.
| |
bounce:Number (default = 1) — The coefficient of restitution for the collision.
|
Boolean — Whether a collision occured.
|
| contains | () | method |
public function contains(x:Number, y:Number):BooleanThe contains method determines whether a point is inside the zone.
Parameters
x:Number — The location to test for.
| |
y:Number |
Boolean — true if point is inside the zone, false if it is outside.
|
| getArea | () | method |
public function getArea():NumberThe getArea method returns the size of the zone. It's used by the MultiZone class to manage the balancing between the different zones.
ReturnsNumber — the size of the zone.
|
| getLocation | () | method |
public function getLocation():PointThe getLocation method returns a random point inside the zone.
ReturnsPoint — a random point inside the zone.
|