net.nexttext.behaviour.control
Class OnMousePressed
java.lang.Object
net.nexttext.behaviour.AbstractAction
net.nexttext.behaviour.control.Condition
net.nexttext.behaviour.control.OnMouseDepressed
net.nexttext.behaviour.control.OnMousePressed
- All Implemented Interfaces:
- Action
- Direct Known Subclasses:
- OnMousePressedOver
public class OnMousePressed
- extends OnMouseDepressed
A Condition which is true when a mouse button is pressed i.e. a single true result
is returned if the button was up and got pressed down.
Constructor Summary |
OnMousePressed(Action trueAction)
Creates an OnMousePressed which performs the given Action when the mouse
button 1 is pressed. |
OnMousePressed(int buttonToCheck,
Action trueAction)
Creates an OnMousePressed which performs the given Action when the selected
mouse button is pressed. |
Method Summary |
boolean |
condition(TextObject to)
Checks whether or not the selected mouse button is pressed. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OnMousePressed
public OnMousePressed(Action trueAction)
- Creates an OnMousePressed which performs the given Action when the mouse
button 1 is pressed.
- Parameters:
trueAction
- the Action to perform when the mouse button 1 is pressed
OnMousePressed
public OnMousePressed(int buttonToCheck,
Action trueAction)
- Creates an OnMousePressed which performs the given Action when the selected
mouse button is pressed.
- Parameters:
buttonToCheck
- the mouse button to considertrueAction
- the Action to perform when the selected mouse button is pressed
condition
public boolean condition(TextObject to)
- Checks whether or not the selected mouse button is pressed.
- Overrides:
condition
in class OnMouseDepressed
- Parameters:
to
- the TextObject to consider (unused)
- Returns:
- the outcome of the condition