Package games.stendhal.client.gui
Class ScreenController
java.lang.Object
games.stendhal.client.gui.ScreenController
- All Implemented Interfaces:
PositionChangeListener
A controller for isolating the out-of event dispatch thread calls to the game
screen.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an emoji image to entity.voidaddText(double x, double y, String text, NotificationType type, boolean isTalking) Adds a text bubble at a given position of the specified type.voidaddText(Entity entity, String text, NotificationType type, boolean isTalking) Adds a text bubble of the specified type that follows an entity.static ScreenControllerget()Retreives the static singleton instance.static ScreenControllerget(GameScreen screen) Retreives the static singleton instance.voidpositionChanged(double x, double y) The user position changed.
-
Method Details
-
get
Retreives the static singleton instance.- Parameters:
screen- Controlled screen.- Returns:
- ScreenController instance.
-
get
Retreives the static singleton instance.- Returns:
- ScreenController instance.
-
addText
Adds a text bubble at a given position of the specified type. For non-talking boxes the coordinates are ignored, and the box is attached to the bottom of the screen.- Parameters:
x- The screen X coordinate.y- The screen Y coordinate.text- The text to be displayed.type- The notification type.isTalking-trueif the text is related to an entity that is talking.- See Also:
-
addText
Adds a text bubble of the specified type that follows an entity. For non-talking boxes entity is ignored, and the box is attached to the bottom of the screen.- Parameters:
entity- The entity to which the text follows.text- The text to be displayed.type- The notification type.isTalking-trueif the text is related to an entity that is talking.
-
addEmoji
Adds an emoji image to entity.- Parameters:
entity- Attached entity.emoji- The emoji image.
-
positionChanged
public void positionChanged(double x, double y) Description copied from interface:PositionChangeListenerThe user position changed.- Specified by:
positionChangedin interfacePositionChangeListener- Parameters:
x- The X coordinate (in world units).y- The Y coordinate (in world units).
-