net.nexttext.behaviour.standard
Class MoveBy

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

public class MoveBy
extends AbstractAction
implements TargetingAction

Move an object by the given vector amount.

The vector amount is added to its position. The value of the Locatable is checked each time behave() is called, so a variable amount can be used.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action
Action.ActionResult
 
Constructor Summary
MoveBy(float x, float y)
           
MoveBy(Locatable offset)
           
MoveBy(processing.core.PVector offset)
           
 
Method Summary
 Action.ActionResult behave(TextObject to)
          Default behave method for single objects.
 void setTarget(float x, float y)
          Sets a target to approach.
 void setTarget(float x, float y, float z)
          Sets a target to approach.
 void setTarget(Locatable offset)
          Sets an offset to move by.
 void setTarget(processing.core.PVector target)
          Sets a target to approach.
 
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
 
Methods inherited from interface net.nexttext.behaviour.Action
behave, behave, complete, getRequiredProperties
 

Constructor Detail

MoveBy

public MoveBy(float x,
              float y)

MoveBy

public MoveBy(Locatable offset)

MoveBy

public MoveBy(processing.core.PVector offset)
Method Detail

behave

public Action.ActionResult behave(TextObject to)
Description copied from class: AbstractAction
Default behave method for single objects.

This method does nothing; it should be overriden by subclasses if they wish to support actions on single objects.

Trying to call this method on an Action which doesn't override it will throw an UnsupportedActionException.

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

setTarget

public void setTarget(float x,
                      float y)
Sets a target to approach.

Specified by:
setTarget in interface TargetingAction

setTarget

public void setTarget(float x,
                      float y,
                      float z)
Sets a target to approach.

Specified by:
setTarget in interface TargetingAction

setTarget

public void setTarget(processing.core.PVector target)
Sets a target to approach.

Specified by:
setTarget in interface TargetingAction

setTarget

public void setTarget(Locatable offset)
Sets an offset to move by.

Specified by:
setTarget in interface TargetingAction