Packageorg.flintparticles.twoD.actions
Classpublic class TurnTowardsMouse
InheritanceTurnTowardsMouse Inheritance ActionBase Inheritance Object
Subclasses TurnAwayFromMouse

The TurnTowardsMouse action causes the particle to constantly adjust its direction so that it travels towards the mouse pointer.



Public Properties
 PropertyDefined By
  power : Number
The strength of the turn action.
TurnTowardsMouse
 Inheritedpriority : 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
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
TurnTowardsMouse(power:Number = 0, renderer:DisplayObject = null)
The constructor creates a TurnTowardsMouse action for use by an emitter.
TurnTowardsMouse
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Calculates the direction to the mouse and turns the particle towards this direction.
TurnTowardsMouse
Property Detail
powerproperty
power:Number

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
rendererproperty 
renderer:DisplayObject

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
Constructor Detail
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.

Parameters
power: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

Method Detail
update()method
override public function update(emitter:Emitter, particle:Particle, time:Number):void

Calculates 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