| Package | org.flintparticles.twoD.actions |
| Class | public class TurnTowardsMouse |
| Inheritance | TurnTowardsMouse ActionBase |
| Subclasses | TurnAwayFromMouse |
| Property | Defined by | ||
|---|---|---|---|
| power : Number
The strength of the turn action.
| TurnTowardsMouse | ||
![]() | priority : int
Returns a default priority of 0 for this action.
| ActionBase | |
| renderer : DisplayObject
The display object whose coordinate system the mouse position is converted to.
| TurnTowardsMouse | ||
| Method | Defined by | ||
|---|---|---|---|
|
TurnTowardsMouse(power:Number = 0, renderer:DisplayObject = null)
The constructor creates a TurnTowardsMouse action for use by an emitter.
| TurnTowardsMouse | ||
![]() |
addedToEmitter(emitter:Emitter):void
This method does nothing.
| ActionBase | |
![]() |
removedFromEmitter(emitter:Emitter):void
This method does nothing.
| ActionBase | |
|
Calculates the direction to the mouse and turns the particle towards
this direction.
| TurnTowardsMouse | ||
| power | property |
power:Number [read-write]The strength of the turn action. Higher values produce a sharper turn.
Implementation public function get power():Number
public function set power(value:Number):void
| renderer | property |
renderer:DisplayObject [read-write]The display object whose coordinate system the mouse position is converted to. This is usually the renderer for the particle system created by the emitter.
Implementation public function get renderer():DisplayObject
public function set renderer(value:DisplayObject):void
| TurnTowardsMouse | () | constructor |
public function TurnTowardsMouse(power:Number = 0, renderer:DisplayObject = null)The constructor creates a TurnTowardsMouse action for use by an emitter. To add a TurnTowardsMouse to all particles created by an emitter, use the emitter's addAction method.
Parameterspower:Number (default = 0) — The strength of the turn action. Higher values produce a sharper turn.
|
|
renderer:DisplayObject (default = null) — The display object whose coordinate system the mouse position is
converted to. This is usually the renderer for the particle system created by the emitter.
|
See also
| update | () | method |
public override function update(emitter:Emitter, particle:Particle, time:Number):voidCalculates the direction to the mouse and turns the particle towards this direction.
This method is called by the emitter and need not be called by the user.
Parametersemitter:Emitter — The Emitter that created the particle.
|
|
particle:Particle — The particle to be updated.
|
|
time:Number — The duration of the frame - used for time based updates.
|
See also