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) voidCalled by the game manager after calling theReferee's gameTurn method.voidCalled by the game manager after calling theReferee's onEnd method.voidCalled by the game manager after calling theReferee's init method.voidremoveTooltipText(Entity<?> entity) Removes the tooltip text linked to the entityvoidsetTooltipText(Entity<?> entity, String text) Sets a tooltip text linked to an entity
-
Method Details
-
onGameInit
public void onGameInit()Description copied from interface:ModuleCalled by the game manager after calling theReferee's init method. The module must be registered to the game manager.- Specified by:
onGameInitin interfaceModule
-
onAfterGameTurn
public void onAfterGameTurn()Description copied from interface:ModuleCalled by the game manager after calling theReferee's gameTurn method. The module must be registered to the game manager.- Specified by:
onAfterGameTurnin interfaceModule
-
onAfterOnEnd
public void onAfterOnEnd()Description copied from interface:ModuleCalled by the game manager after calling theReferee's onEnd method. The module must be registered to the game manager.- Specified by:
onAfterOnEndin interfaceModule
-
setTooltipText
Sets a tooltip text linked to an entity- Parameters:
entity- theEntityto link the tooltip totext- is the tooltip text that will be displayed when hovering over the entity
-
getTooltipText
- Parameters:
entity- theEntityto 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- theEntityto remove a tooltip from
-