Packageorg.MARS.view.shape
Classpublic class Shape
SubclassesCircle, CubicBezierCurve, Polygon

Implements the basic shape functionality shared by all subclasses.

See also

Circle
Polygon


Public Properties
 PropertyDefined 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
Protected Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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(displacement:Vector):void
Translate shape using a given displacement vector.
Shape
Property detail
alphaproperty
public var alpha:Number

Shape's transparency (0 to 1)

_anchorproperty 
protected var _anchor:IBody

The object to which the shape is attached

anchorproperty 
anchor:IBody  [read-write]Implementation
    public function get anchor():IBody
    public function set anchor(value:IBody):void
boundingBoxproperty 
boundingBox:AABR  [read-only]Implementation
    public function get boundingBox():AABR
_centerproperty 
protected var _center:Vector

Displacement vector

collisionTypeIDproperty 
collisionTypeID:String  [read-only]Implementation
    public function get collisionTypeID():String
colorproperty 
public var color:uint

Shape's color

displacementproperty 
displacement:Vector  [read-only]Implementation
    public function get displacement():Vector
hashSizeproperty 
public var hashSize:Number

Size of hash (circle in the center of the object)

inverseMassproperty 
inverseMass:Number  [read-only]Implementation
    public function get inverseMass():Number
_isAnchoredproperty 
protected var _isAnchored:Boolean

Flag the shows if the shape is attached to an object

isAnchoredproperty 
isAnchored:Boolean  [read-only]Implementation
    public function get isAnchored():Boolean
_isCollidingproperty 
protected var _isColliding:Boolean = false
isCollidingproperty 
isColliding:Boolean  [read-write]Implementation
    public function get isColliding():Boolean
    public function set isColliding(value:Boolean):void
_isOnTableproperty 
protected var _isOnTable:Boolean = true
isOnTableproperty 
isOnTable:Boolean  [read-write]Implementation
    public function get isOnTable():Boolean
    public function set isOnTable(value:Boolean):void
lineColorproperty 
public var lineColor:uint

Line color

lineThicknessproperty 
public var lineThickness:Number

Line thickness

massproperty 
mass:Number  [read-only]Implementation
    public function get mass():Number
positionproperty 
position:Vector  [read-only]Implementation
    public function get position():Vector
_qproperty 
protected var _q:Number = 0

Shape's rotation in radians

qproperty 
q:Number  [read-only]Implementation
    public function get q():Number
rotationproperty 
rotation:RotationMatrix  [read-only]Implementation
    public function get rotation():RotationMatrix
xproperty 
x:Number  [read-write]Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number  [read-write]Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor detail
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

Parameters
x: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)
Method detail
rotate()method
public function rotate(q:Number):void

Rotate the shape

Parameters
q:Number — - rottion amount in radians
translate()method 
public function translate(displacement:Vector):void

Translate shape using a given displacement vector.

Parameters
displacement:Vector