| Package | org.flintparticles.twoD.zones |
| Class | public class RectangleZone |
| Inheritance | RectangleZone Object |
| Implements | Zone2D |
| Property | Defined By | ||
|---|---|---|---|
| bottom : Number
The bottom coordinate of the rectangle defining the region of the zone. | RectangleZone | ||
| left : Number
The left coordinate of the rectangle defining the region of the zone. | RectangleZone | ||
| right : Number
The right coordinate of the rectangle defining the region of the zone. | RectangleZone | ||
| top : Number
The top coordinate of the rectangle defining the region of the zone. | RectangleZone | ||
| Method | Defined By | ||
|---|---|---|---|
RectangleZone(left:Number = 0, top:Number = 0, right:Number = 0, bottom:Number = 0)
The constructor creates a RectangleZone zone. | RectangleZone | ||
collideParticle(particle:Particle2D, bounce:Number = 1):Boolean
Manages collisions between a particle and the zone. | RectangleZone | ||
contains(x:Number, y:Number):Boolean
The contains method determines whether a point is inside the zone. | RectangleZone | ||
getArea():Number
The getArea method returns the size of the zone. | RectangleZone | ||
getLocation():Point
The getLocation method returns a random point inside the zone. | RectangleZone | ||
| bottom | property |
bottom:NumberThe bottom coordinate of the rectangle defining the region of the zone.
public function get bottom():Number public function set bottom(value:Number):void| left | property |
left:NumberThe left coordinate of the rectangle defining the region of the zone.
public function get left():Number public function set left(value:Number):void| right | property |
right:NumberThe right coordinate of the rectangle defining the region of the zone.
public function get right():Number public function set right(value:Number):void| top | property |
top:NumberThe top coordinate of the rectangle defining the region of the zone.
public function get top():Number public function set top(value:Number):void| RectangleZone | () | Constructor |
public function RectangleZone(left:Number = 0, top:Number = 0, right:Number = 0, bottom:Number = 0)The constructor creates a RectangleZone zone.
Parametersleft:Number (default = 0) — The left coordinate of the rectangle defining the region of the zone.
| |
top:Number (default = 0) — The top coordinate of the rectangle defining the region of the zone.
| |
right:Number (default = 0) — The right coordinate of the rectangle defining the region of the zone.
| |
bottom:Number (default = 0) — The bottom coordinate of the rectangle defining the region of the zone.
|
| collideParticle | () | method |
public function collideParticle(particle:Particle2D, bounce:Number = 1):BooleanManages collisions between a particle and the zone. Particles will collide with the edges of the rectangle defined for this zone, from inside or outside the zone. The collisionRadius of the particle is used when calculating the collision.
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. This method is used by the initializers and actions that use the zone. Usually, it need not be called directly by the user.
Parameters
x:Number — The x coordinate of the location to test for.
| |
y:Number — The y coordinate of the location to test for.
|
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. This method is used by the MultiZone class. Usually, it need not be called directly by the user.
ReturnsNumber — a random point inside the zone.
|
| getLocation | () | method |
public function getLocation():PointThe getLocation method returns a random point inside the zone. This method is used by the initializers and actions that use the zone. Usually, it need not be called directly by the user.
ReturnsPoint — a random point inside the zone.
|