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()
      Specified by:
      onGameInit in interface Module
    • onAfterGameTurn

      public void onAfterGameTurn()
      Specified by:
      onAfterGameTurn in interface Module
    • onAfterOnEnd

      public void onAfterOnEnd()
      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