Class ScreenController

java.lang.Object
games.stendhal.client.gui.ScreenController
All Implemented Interfaces:
PositionChangeListener

public class ScreenController extends Object implements PositionChangeListener
A controller for isolating the out-of event dispatch thread calls to the game screen.
  • Method Details

    • get

      public static ScreenController get(GameScreen screen)
      Retreives the static singleton instance.
      Parameters:
      screen - Controlled screen.
      Returns:
      ScreenController instance.
    • get

      public static ScreenController get()
      Retreives the static singleton instance.
      Returns:
      ScreenController instance.
    • addText

      public void addText(double x, double y, String text, NotificationType type, boolean isTalking)
      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 - true if the text is related to an entity that is talking.
      See Also:
    • addText

      public void addText(Entity entity, String text, NotificationType type, boolean isTalking)
      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 - true if the text is related to an entity that is talking.
    • addEmoji

      public void addEmoji(Entity entity, Sprite emoji)
      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: PositionChangeListener
      The user position changed.
      Specified by:
      positionChanged in interface PositionChangeListener
      Parameters:
      x - The X coordinate (in world units).
      y - The Y coordinate (in world units).