User Tools

Site Tools


set_entity_tooltip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
set_entity_tooltip [2017/10/12 09:35] justinset_entity_tooltip [2021/04/21 18:51] (current) justin
Line 2: Line 2:
 ---- ----
  
-Sets the tooltip for the specified entity. An empty string value can be specified for the tooltip text in order to remove the entity's tooltip.+Sets the tooltip for the specified [[entity]]. An empty [[string]] value can be specified for the tooltip text in order to remove the [[entity|entity's]] tooltip.
  
 +====Signature:====
 <code python> <code python>
 set_entity_tooltip(entity, tooltip_text) set_entity_tooltip(entity, tooltip_text)
Line 9: Line 10:
  
 ^Argument^Description^Type^Required^ ^Argument^Description^Type^Required^
-|entity|Entity for which to change the tooltip.|[[Entity]]|Yes| +|entity|[[Entity]] to change the tooltip for.|[[Entity]]|Yes| 
-|tooltip_text|Text to display for the tooltip.|[[String]]|Yes|+|tooltip_text|Text to display in the tooltip.|[[String]]|Yes| 
 + 
 +<WRAP center round info 100%> 
 +You can use [[placeholder expression|placeholder expressions]] within the tooltip text, for example to update an [[entity|entity's]] tooltip based on the current value of a stat or custom property of that [[entity]]. 
 +</WRAP>
  
 ====Example:==== ====Example:====
-<code lua+<code bauxite
-set_entity_tooltip(self, "Wooden Chest")+set_entity_tooltip(self, "Wooden Chest");
 </code> </code>
-//Results:// The tooltip text for the entity that triggered this script will be changed to "Wooden Chest".+//Results:// The tooltip text for the [[entity]] that triggered this [[script]] will be changed to "Wooden Chest".
  
 <WRAP center round tip 100%> <WRAP center round tip 100%>
-Use the **Set Entity Tooltip** function to set some initial descriptive tooltip text onto an object that has just become interactable or to update the existing tooltip text of an object whose appearance or purpose has changed.+Use the **Set Entity Tooltip** function to set some initial descriptive tooltip text onto an [[object]] that has just become interactable or to update the existing tooltip text of an [[object]] whose appearance or purpose has changed.
 </WRAP> </WRAP>
  
set_entity_tooltip.1507826102.txt.gz · Last modified: 2017/10/12 09:35 by justin