net.nexttext.behaviour.standard
Class FadeTo

java.lang.Object
  extended by net.nexttext.behaviour.AbstractAction
      extended by net.nexttext.behaviour.standard.FadeTo
All Implemented Interfaces:
Action

public class FadeTo
extends AbstractAction

This action fades an object's color alpha component to the specified value and at a given speed.

It does not modify the object's color. Instead, see Colorize.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action
Action.ActionResult
 
Constructor Summary
FadeTo()
          Default constructor.
FadeTo(int fadeTo, int speed)
          Creates a FadeTo action with the parameters passed as arguments.
FadeTo(int fadeTo, int speed, boolean fill, boolean stroke)
          Creates a FadeTo action with the parameters passed as arguments.
FadeTo(int fadeToFill, int speedFill, int fadeToStroke, int speedStroke)
          Creates a FadeTo action with the parameters passed as arguments.
 
Method Summary
 Action.ActionResult behave(TextObject to)
          Applies the Fade action to a TextObject.
 
Methods inherited from class net.nexttext.behaviour.AbstractAction
behave, behave, complete, getDisplayName, getRequiredProperties, makeBehaviour, properties, setDisplayName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FadeTo

public FadeTo()
Default constructor. Fades the fill colour to alpha 0 by default at a speed of 10.

This constructor is kept for code consistency with code that was using FadeTo prior to the implementation of the stroke property.


FadeTo

public FadeTo(int fadeTo,
              int speed)
Creates a FadeTo action with the parameters passed as arguments. By default the parameters affect the fill color.

This constructor is kept for code consistency with code that was using FadeTo prior to the implementation of the stroke property.

Parameters:
fadeTo - A target alpha value in the range 0..255
speed - The fade speed

FadeTo

public FadeTo(int fadeTo,
              int speed,
              boolean fill,
              boolean stroke)
Creates a FadeTo action with the parameters passed as arguments.

Parameters:
fadeTo - A target alpha value in the range 0..255
speed - The fade speed
fill - Indicates if the action has to be processed on the fill
stroke - Indicates if the action has to be processed on the stroke

FadeTo

public FadeTo(int fadeToFill,
              int speedFill,
              int fadeToStroke,
              int speedStroke)
Creates a FadeTo action with the parameters passed as arguments.

Parameters:
fadeToFill - A target fill color alpha value in the range 0..255
speedFill - The fill color fade speed
fadeToStroke - A target stroke color alpha value in the range 0..255
speedStroke - The stroke color fade speed
Method Detail

behave

public Action.ActionResult behave(TextObject to)
Applies the Fade action to a TextObject.

The returned ActionResult will set complete when the alpha value has been reached, and will never return events.

Specified by:
behave in interface Action
Overrides:
behave in class AbstractAction