Kenpachi™ Posted October 15, 2013 Share Posted October 15, 2013 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(); endendTooltip appears, but does not disappear. What am I doing wrong? Link to comment Share on other sites More sharing options...
RoboMat Posted October 15, 2013 Share Posted October 15, 2013 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. Kenpachi™ 1 Link to comment Share on other sites More sharing options...
Kenpachi™ Posted October 16, 2013 Author Share Posted October 16, 2013 Just a guess, but:self.toolTip = ISToolTip:new();does create a new Tool Tip every time the code is run. Yeah, my bad. Think you are right, i will test it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now