Class TooltipModule

java.lang.Object
com.codingame.gameengine.module.tooltip.TooltipModule
All Implemented Interfaces:
Module

public class TooltipModule extends Object implements Module
The TooltipModule takes care of displaying tooltips under the mouse cursor when an element has a linked tooltip text.
  • Method Details

    • onGameInit

      public void onGameInit()
      Description copied from interface: Module
      Called by the game manager after calling the Referee's init method. The module must be registered to the game manager.
      Specified by:
      onGameInit in interface Module
    • onAfterGameTurn

      public void onAfterGameTurn()
      Description copied from interface: Module
      Called by the game manager after calling the Referee's gameTurn method. The module must be registered to the game manager.
      Specified by:
      onAfterGameTurn in interface Module
    • onAfterOnEnd

      public void onAfterOnEnd()
      Description copied from interface: Module
      Called by the game manager after calling the Referee's onEnd method. The module must be registered to the game manager.
      Specified by:
      onAfterOnEnd in interface Module
    • setTooltipText

      public void setTooltipText(Entity<?> entity, String text)
      Sets a tooltip text linked to an entity
      Parameters:
      entity - the Entity to link the tooltip to
      text - is the tooltip text that will be displayed when hovering over the entity
    • getTooltipText

      public String getTooltipText(Entity<?> entity)
      Parameters:
      entity - the Entity to get the associated tooltip text from
      Returns:
      the tooltip text linked to the entity
    • removeTooltipText

      public void removeTooltipText(Entity<?> entity)
      Removes the tooltip text linked to the entity
      Parameters:
      entity - the Entity to remove a tooltip from