| Package | org.flintparticles.twoD.zones |
| Class | public class BitmapDataZone |
| Implements | Zone2D |
| Property | Defined by | ||
|---|---|---|---|
| bitmapData : BitmapData
The bitmapData object that defines the zone.
| BitmapDataZone | ||
| offsetX : Number
A horizontal offset to apply to the pixels in the BitmapData object
to reposition the zone
| BitmapDataZone | ||
| offsetY : Number
A vertical offset to apply to the pixels in the BitmapData object
to reposition the zone
| BitmapDataZone | ||
| scaleX : Number
A scale factor to stretch the bitmap horizontally
| BitmapDataZone | ||
| scaleY : Number
A scale factor to stretch the bitmap vertically
| BitmapDataZone | ||
| Method | Defined by | ||
|---|---|---|---|
|
BitmapDataZone(bitmapData:BitmapData, offsetX:Number = 0, offsetY:Number = 0, scaleX:Number = 1, scaleY:Number = 1)
The constructor creates a BitmapDataZone object.
| BitmapDataZone | ||
|
contains(x:Number, y:Number):Boolean
The contains method determines whether a point is inside the zone.
| BitmapDataZone | ||
|
getArea():Number
The getArea method returns the size of the zone.
| BitmapDataZone | ||
|
getLocation():Point
The getLocation method returns a random point inside the zone.
| BitmapDataZone | ||
|
invalidate():void
This method forces the zone to revaluate itself.
| BitmapDataZone | ||
| bitmapData | property |
bitmapData:BitmapData [read-write]The bitmapData object that defines the zone.
Implementation public function get bitmapData():BitmapData
public function set bitmapData(value:BitmapData):void
| offsetX | property |
offsetX:Number [read-write]A horizontal offset to apply to the pixels in the BitmapData object to reposition the zone
Implementation public function get offsetX():Number
public function set offsetX(value:Number):void
| offsetY | property |
offsetY:Number [read-write]A vertical offset to apply to the pixels in the BitmapData object to reposition the zone
Implementation public function get offsetY():Number
public function set offsetY(value:Number):void
| scaleX | property |
scaleX:Number [read-write]A scale factor to stretch the bitmap horizontally
Implementation public function get scaleX():Number
public function set scaleX(value:Number):void
| scaleY | property |
scaleY:Number [read-write]A scale factor to stretch the bitmap vertically
Implementation public function get scaleY():Number
public function set scaleY(value:Number):void
| BitmapDataZone | () | constructor |
public function BitmapDataZone(bitmapData:BitmapData, offsetX:Number = 0, offsetY:Number = 0, scaleX:Number = 1, scaleY:Number = 1)The constructor creates a BitmapDataZone object.
ParametersbitmapData:BitmapData — The bitmapData object that defines the zone.
|
|
offsetX:Number (default = 0) — A horizontal offset to apply to the pixels in the BitmapData object
to reposition the zone
|
|
offsetY:Number (default = 0) — A vertical offset to apply to the pixels in the BitmapData object
to reposition the zone
|
|
scaleX:Number (default = 1) — A scale factor to stretch the bitmap horizontally
|
|
scaleY:Number (default = 1) — A scale factor to stretch the bitmap vertically
|
| contains | () | method |
public function contains(x:Number, y:Number):BooleanThe contains method determines whether a point is inside the zone.
Parametersx: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.
|
| invalidate | () | method |
public function invalidate():voidThis method forces the zone to revaluate itself. It should be called whenever the contents of the BitmapData object change. However, it is an intensive method and calling it frequently will likely slow your code down.