Packagecitrus.physics.nape
Classpublic class Nape
InheritanceNape Inheritance APhysicsEngine Inheritance CitrusObject Inheritance Object
Implements ISpriteView

This is a simple wrapper class that allows you to add a Nape space to your game's state. Add an instance of this class to your State before you create any physics bodies. It will need to exist first, or your physics bodies will throw an error when they try to create themselves.



Public Properties
 PropertyDefined By
 Inheritedanimation : String
[read-only]
APhysicsEngine
 Inheritedart : ICitrusArt
[read-only]
APhysicsEngine
  contactListener : NapeContactListener
[read-only] Return a ContactListener class where some InteractionListeners are already defined.
Nape
 InheriteddebugView : IDebugView
[read-only] Shortcut to the debugView use to change the debug drawer's flags with debugView.debugMode() or access it directly through debugView.debugDrawer.
APhysicsEngine
 Inheriteddepth : Number
[read-only]
APhysicsEngine
  gravity : Vec2
Change the gravity of the space.
Nape
 Inheritedgroup : uint
APhysicsEngine
 Inheritedheight : Number
[read-only]
APhysicsEngine
 InheritedhideParamWarnings : Boolean = false
[static]
CitrusObject
 InheritedID : uint
[read-only]
CitrusObject
 Inheritedinverted : Boolean
[read-only]
APhysicsEngine
 Inheritedkill : Boolean = false
Set it to true if you want to remove, clean and destroy the object.
CitrusObject
 Inheritedname : String
A name to identify easily an objet.
CitrusObject
 InheritedoffsetX : Number
[read-only]
APhysicsEngine
 InheritedoffsetY : Number
[read-only]
APhysicsEngine
 InheritedparallaxX : Number
[read-only]
APhysicsEngine
 InheritedparallaxY : Number
[read-only]
APhysicsEngine
  positionIterations : uint = 8
ositionIterations for the position constraint solver.
Nape
 InheritedrealDebugView : *
[read-only]
APhysicsEngine
 Inheritedregistration : String
[read-only]
APhysicsEngine
 Inheritedrotation : Number
[read-only]
APhysicsEngine
  space : Space
[read-only] Gets a reference to the actual Nape space object.
Nape
  timeStep : Number
timeStep the amount of time to simulate, this should not vary.
Nape
 Inheritedtouchable : Boolean
APhysicsEngine
 Inheritedtype : String = classicObject
Added to the CE's render list via the State and the add method.
CitrusObject
 InheritedupdateCallEnabled : Boolean = false
This property prevent the update method to be called by the enter frame, it will save performances.
CitrusObject
 Inheritedvelocity : Array
[read-only]
APhysicsEngine
  velocityIterations : uint = 8
velocityIterations for the velocity constraint solver.
Nape
 Inheritedview : *
APhysicsEngine
 Inheritedvisible : Boolean
APhysicsEngine
 Inheritedwidth : Number
[read-only]
APhysicsEngine
 Inheritedx : Number
[read-only]
APhysicsEngine
 Inheritedy : Number
[read-only]
APhysicsEngine
 Inheritedz : Number
[read-only]
APhysicsEngine
Protected Properties
 PropertyDefined By
 Inherited_art : ICitrusArt
APhysicsEngine
 Inherited_ce : CitrusEngine
CitrusObject
 Inherited_group : uint = 1
APhysicsEngine
 Inherited_initialized : Boolean = false
CitrusObject
 Inherited_params : Object
CitrusObject
 Inherited_realDebugView : *
APhysicsEngine
 Inherited_timeDelta : Number
The time elasped between two update call.
CitrusObject
 Inherited_touchable : Boolean = false
APhysicsEngine
 Inherited_view : *
APhysicsEngine
 Inherited_visible : Boolean = false
APhysicsEngine
Public Methods
 MethodDefined By
  
Nape(name:String, params:Object = null)
Creates and initializes a Nape space.
Nape
  
destroy():void
[override]
Nape
 Inherited
APhysicsEngine
 Inherited
APhysicsEngine
 Inherited
handleArtReady(citrusArt:ICitrusArt):void
APhysicsEngine
  
initialize(poolObjectParams:Object = null):void
[override]
Nape
 Inherited
setParams(object:Object, params:Object):void
The initialize method usually calls this.
CitrusObject
 Inherited
toString():String
CitrusObject
  
update(timeDelta:Number):void
[override] This is where the time step of the physics world occurs.
Nape
Property Detail
contactListenerproperty
contactListener:NapeContactListener  [read-only]

Return a ContactListener class where some InteractionListeners are already defined.


Implementation
    public function get contactListener():NapeContactListener
gravityproperty 
gravity:Vec2

Change the gravity of the space.


Implementation
    public function get gravity():Vec2
    public function set gravity(value:Vec2):void
positionIterationsproperty 
public var positionIterations:uint = 8

ositionIterations for the position constraint solver.

spaceproperty 
space:Space  [read-only]

Gets a reference to the actual Nape space object.


Implementation
    public function get space():Space
timeStepproperty 
public var timeStep:Number

timeStep the amount of time to simulate, this should not vary.

velocityIterationsproperty 
public var velocityIterations:uint = 8

velocityIterations for the velocity constraint solver.

Constructor Detail
Nape()Constructor
public function Nape(name:String, params:Object = null)

Creates and initializes a Nape space.

Parameters
name:String
 
params:Object (default = null)
Method Detail
destroy()method
override public function destroy():void

initialize()method 
override public function initialize(poolObjectParams:Object = null):void

Parameters

poolObjectParams:Object (default = null)

update()method 
override public function update(timeDelta:Number):void

This is where the time step of the physics world occurs.

Parameters

timeDelta:Number