Packageorg.flintparticles.zones
Classpublic class LinearRectangleZone
InheritanceLinearRectangleZone Inheritance RectangleZone

The LinearRectangleZone defines a rectangle shaped zone in which locations are returned in a regular linear pattern, rather than the random pattern of the standard RectangleZone.



Public Properties
 PropertyDefined by
 Inheritedbottom : Number
The bottom coordinate of the rectangle defining the region of the zone.
RectangleZone
 Inheritedheight : Number
The height of the rectangle defining the region of the zone.
RectangleZone
 Inheritedleft : Number
The left coordinate of the rectangle defining the region of the zone.
RectangleZone
 Inheritedright : Number
The right coordinate of the rectangle defining the region of the zone.
RectangleZone
 Inheritedtop : Number
The top coordinate of the rectangle defining the region of the zone.
RectangleZone
 Inheritedwidth : Number
The width of the rectangle defining the region of the zone.
RectangleZone
Public Methods
 MethodDefined 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
 Inherited
contains(x:Number, y:Number):Boolean
The contains method determines whether a point is inside the zone.
RectangleZone
 Inherited
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
Constructor detail
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.

Parameters
left: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)
Method detail
getLocation()method
public override function getLocation():Point

The 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.

Returns
Point — a random point inside the zone.