Jump to content

Image tooltip


Kenpachi™

Recommended Posts

How i can add an tooltip to image?

I tried:

function ISImage:render()	self.toolTip = ISToolTip:new();	self.toolTip:initialise();	self.toolTip:setVisible(false);		if self.mouseover then		self.toolTip.description = self.tooltiptext;		self.toolTip:setVisible(true);		self.toolTip:addToUIManager();	else		self.toolTip:setVisible(false);		self.toolTip:removeFromUIManager();	endend

Tooltip appears, but does not disappear. What am I doing wrong?

 

Link to comment
Share on other sites

Just a guess, but:

 

self.toolTip = ISToolTip:new();

does create a new Tool Tip every time the code is run. This means that  

if self.mouseover then        self.toolTip.description = self.tooltiptext;        self.toolTip:setVisible(true);        self.toolTip:addToUIManager();    else        self.toolTip:setVisible(false);        self.toolTip:removeFromUIManager();    end

 

will only be called once for that particular ToolTip. I haven't looked at GUI too much yet, but I guess there is a "update" function somewhere, where you could check for the mouseover stuff.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...