| Package | org.MARS.view.shape |
| Class | public class Shape |
| Subclasses | Circle, CubicBezierCurve, Polygon |
See also
| Property | Defined by | ||
|---|---|---|---|
| alpha : Number Shape's transparency (0 to 1)
| Shape | ||
| anchor : IBody | Shape | ||
| boundingBox : AABR
[read-only]
| Shape | ||
| collisionTypeID : String [read-only]
| Shape | ||
| color : uint Shape's color
| Shape | ||
| displacement : Vector
[read-only]
| Shape | ||
| hashSize : Number Size of hash (circle in the center of the object)
| Shape | ||
| inverseMass : Number [read-only]
| Shape | ||
| isAnchored : Boolean [read-only]
| Shape | ||
| isColliding : Boolean | Shape | ||
| isOnTable : Boolean | Shape | ||
| lineColor : uint Line color
| Shape | ||
| lineThickness : Number Line thickness
| Shape | ||
| mass : Number [read-only]
| Shape | ||
| position : Vector
[read-only]
| Shape | ||
| q : Number [read-only]
| Shape | ||
| rotation : RotationMatrix
[read-only]
| Shape | ||
| x : Number | Shape | ||
| y : Number | Shape | ||
| Property | Defined by | ||
|---|---|---|---|
| _anchor : IBody
The object to which the shape is attached
| Shape | ||
| _center : Vector
Displacement vector
| Shape | ||
| _isAnchored : Boolean Flag the shows if the shape is attached to an object
| Shape | ||
| _isColliding : Boolean = false | Shape | ||
| _isOnTable : Boolean = true | Shape | ||
| _q : Number = 0 Shape's rotation in radians
| Shape | ||
| Method | Defined by | ||
|---|---|---|---|
|
Shape(x:Number, y:Number, q:Number = 0, anchor:IBody = null, color:uint = 0xFFFFFF, alpha:Number = 0.7, lineColor:uint = 0x000000, lineThickness:Number = 1, hashSize:Number = 5)
Create a shape with the following parameters
| Shape | ||
|
rotate(q:Number):void
Rotate the shape
| Shape | ||
|
Translate shape using a given displacement vector.
| Shape | ||
| alpha | property |
public var alpha:NumberShape's transparency (0 to 1)
| _anchor | property |
protected var _anchor:IBodyThe object to which the shape is attached
| anchor | property |
anchor:IBody [read-write]Implementation
public function get anchor():IBody
public function set anchor(value:IBody):void
| boundingBox | property |
| _center | property |
protected var _center:VectorDisplacement vector
| collisionTypeID | property |
collisionTypeID:String [read-only]Implementation
public function get collisionTypeID():String
| color | property |
public var color:uintShape's color
| displacement | property |
| hashSize | property |
public var hashSize:NumberSize of hash (circle in the center of the object)
| inverseMass | property |
inverseMass:Number [read-only]Implementation
public function get inverseMass():Number
| _isAnchored | property |
protected var _isAnchored:BooleanFlag the shows if the shape is attached to an object
| isAnchored | property |
isAnchored:Boolean [read-only]Implementation
public function get isAnchored():Boolean
| _isColliding | property |
protected var _isColliding:Boolean = false
| isColliding | property |
isColliding:Boolean [read-write]Implementation
public function get isColliding():Boolean
public function set isColliding(value:Boolean):void
| _isOnTable | property |
protected var _isOnTable:Boolean = true
| isOnTable | property |
isOnTable:Boolean [read-write]Implementation
public function get isOnTable():Boolean
public function set isOnTable(value:Boolean):void
| lineColor | property |
public var lineColor:uintLine color
| lineThickness | property |
public var lineThickness:NumberLine thickness
| mass | property |
mass:Number [read-only]Implementation
public function get mass():Number
| position | property |
| _q | property |
protected var _q:Number = 0Shape's rotation in radians
| q | property |
q:Number [read-only]Implementation
public function get q():Number
| rotation | property |
| x | property |
x:Number [read-write]Implementation
public function get x():Number
public function set x(value:Number):void
| y | property |
y:Number [read-write]Implementation
public function get y():Number
public function set y(value:Number):void
| Shape | () | constructor |
public function Shape(x:Number, y:Number, q:Number = 0, anchor:IBody = null, color:uint = 0xFFFFFF, alpha:Number = 0.7, lineColor:uint = 0x000000, lineThickness:Number = 1, hashSize:Number = 5)Create a shape with the following parameters
Parametersx:Number |
|
y:Number |
|
q:Number (default = 0) |
|
anchor:IBody (default = null) |
|
color:uint (default = 0xFFFFFF) |
|
alpha:Number (default = 0.7) |
|
lineColor:uint (default = 0x000000) |
|
lineThickness:Number (default = 1) |
|
hashSize:Number (default = 5) |
| rotate | () | method |
public function rotate(q:Number):voidRotate the shape
Parametersq:Number — - rottion amount in radians
|
| translate | () | method |
public function translate(displacement:Vector):voidTranslate shape using a given displacement vector.
Parametersdisplacement:Vector |