| Package | org.flintparticles.twoD.actions |
| Class | public class TurnTowardsMouse |
| Inheritance | TurnTowardsMouse ActionBase Object |
| 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 | |
[override]
Calculates the direction to the mouse and turns the particle towards
this direction. | TurnTowardsMouse | ||
| power | property |
power:NumberThe strength of the turn action. Higher values produce a sharper turn.
public function get power():Number public function set power(value:Number):void| renderer | property |
renderer:DisplayObjectThe display object whose coordinate system the mouse position is converted to. This is usually the renderer for the particle system created by the emitter.
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 |
override public 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.
Parameters
emitter: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