| Package | org.flintparticles.zones |
| Class | public class LinearRectangleZone |
| Inheritance | LinearRectangleZone RectangleZone |
| Method | Defined by | ||
|---|---|---|---|
|
LinearRectangleZone(left:Number, top:Number, right:Number, bottom:Number, start:String = "topLeft", direction:String = "horizontal", horizontalStep:Number = 1, verticalStep:Number = 1)
The constructor creates a LinearRectangleZone zone.
| LinearRectangleZone | ||
![]() |
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.
| LinearRectangleZone | ||
| LinearRectangleZone | () | constructor |
public function LinearRectangleZone(left:Number, top:Number, right:Number, bottom:Number, start:String = "topLeft", direction:String = "horizontal", horizontalStep:Number = 1, verticalStep:Number = 1)The constructor creates a LinearRectangleZone zone.
Parametersleft:Number — The left coordinate of the rectangle defining the region of the zone.
|
|
top:Number — The top coordinate of the rectangle defining the region of the zone.
|
|
right:Number — The right coordinate of the rectangle defining the region of the zone.
|
|
bottom:Number — The bottom coordinate of the rectangle defining the region of the zone.
|
|
start:String (default = "topLeft") — The position in the zone to start getting locations - may be any corner
of the rectangle. The allowed values are defined in the ZoneConstants class as
ZoneConstants.TOP_LEFT, ZoneConstants.TOP_RIGHT, ZoneConstants.BOTTOM_LEFT
and ZoneConstants.BOTTOM_RIGHT.
|
|
direction:String (default = "horizontal") — The direction to advance first. If ZoneConstants.HORIZONTAL, the locations
advance horizontally across the zone, moving vertically when wrapping around at the end. If
ZoneConstants.VERTICAL, the locations advance vertically up/down the zone, moving horizontally
when wrapping around at the top/bottom.
|
|
horizontalStep:Number (default = 1) |
|
verticalStep:Number (default = 1) |
| getLocation | () | method |
public override 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.
|