Hello,
Wondering if anyone can help me solve a problem concerning tooltips. I have a character screen and a tooltip at the bottom of the screen to explain the label/button the player has the mouse over. This is working fine, but I’d like to have the text change depending on certain conditions present in the scene.
Example
// Speed + Button
if(GUI.Button(new Rect(x, y, a, b), new GUIContent("", "Increases Character Speed"), "StatButton")
{
// Condition satisfied
if(freeAttributePoints > 0)
{
// No need to show a message, just leave the button GUI content
}
// Condition not satisfied
else
{
// Show a different message on tooltip, i.e. No free attribute points
}
}
How I’m declaring tooltip:
// ToolTip Label
GUI.Label(new Rect(0, tooltipYPos, tooltipWidth, tooltipHeight), GUI.tooltip, "ToolTip");
Thanks for reading!