net.nexttext.behaviour.control
Class OnMousePressedOver
java.lang.Object
net.nexttext.behaviour.AbstractAction
net.nexttext.behaviour.control.Condition
net.nexttext.behaviour.control.OnMouseDepressed
net.nexttext.behaviour.control.OnMousePressed
net.nexttext.behaviour.control.OnMousePressedOver
- All Implemented Interfaces:
- Action
public class OnMousePressedOver
- extends OnMousePressed
A Condition which is true when a mouse button is pressed over a TextObject
i.e. a single true result is returned if the button was up and got pressed
down on top of the given TextObject.
Constructor Summary |
OnMousePressedOver(Action trueAction)
Creates an OnMousePressedOver which performs the given Action when the mouse
button 1 is pressed. |
OnMousePressedOver(int buttonToCheck,
Action trueAction)
Creates an OnMousePressedOver 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 over the TextObject. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OnMousePressedOver
public OnMousePressedOver(Action trueAction)
- Creates an OnMousePressedOver 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
OnMousePressedOver
public OnMousePressedOver(int buttonToCheck,
Action trueAction)
- Creates an OnMousePressedOver 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 over the TextObject.
- Overrides:
condition
in class OnMousePressed
- Parameters:
to
- the TextObject to consider
- Returns:
- the outcome of the condition