Class TooltipModule
java.lang.Object
com.codingame.gameengine.module.tooltip.TooltipModule
- All Implemented Interfaces:
Module
The TooltipModule takes care of displaying tooltips under the mouse cursor when an element has a linked tooltip text.
-
Method Summary
Modifier and TypeMethodDescriptiongetTooltipText
(Entity<?> entity) void
Called by the game manager after calling theReferee
's gameTurn method.void
Called by the game manager after calling theReferee
's onEnd method.void
Called by the game manager after calling theReferee
's init method.void
removeTooltipText
(Entity<?> entity) Removes the tooltip text linked to the entityvoid
setTooltipText
(Entity<?> entity, String text) Sets a tooltip text linked to an entity
-
Method Details
-
onGameInit
public void onGameInit()Description copied from interface:Module
Called by the game manager after calling theReferee
's init method. The module must be registered to the game manager.- Specified by:
onGameInit
in interfaceModule
-
onAfterGameTurn
public void onAfterGameTurn()Description copied from interface:Module
Called by the game manager after calling theReferee
's gameTurn method. The module must be registered to the game manager.- Specified by:
onAfterGameTurn
in interfaceModule
-
onAfterOnEnd
public void onAfterOnEnd()Description copied from interface:Module
Called by the game manager after calling theReferee
's onEnd method. The module must be registered to the game manager.- Specified by:
onAfterOnEnd
in interfaceModule
-
setTooltipText
Sets a tooltip text linked to an entity- Parameters:
entity
- theEntity
to link the tooltip totext
- is the tooltip text that will be displayed when hovering over the entity
-
getTooltipText
- Parameters:
entity
- theEntity
to get the associated tooltip text from- Returns:
- the tooltip text linked to the entity
-
removeTooltipText
Removes the tooltip text linked to the entity- Parameters:
entity
- theEntity
to remove a tooltip from
-