• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

hovering on a widget

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
How does "onHoverChange" to execute a function when i hover on a widget?
 
Example:

Code:
  someLabelWidget.onHoverChange = function(widget, hoverState) 
    if hoverState then
      print (widget:getId())
    end 
  end
 
Yes.
Code:
&onHoverChanged: function(self, hoverState) if hoverState then doSmth() end end

This should do it.
 
Well i have tried this before but itdont work donno why
Code:
HealthBar < ProgressBar
  id: healthBar
  height: 12
  background-color: #ff4444
  anchors.top: parent.top
  anchors.left: prev.right
  anchors.right: parent.right
  margin-left: 5
  margin-top: 10
  &onHoverChanged: function( self,hoverState) if hoverState then print("lol") end end
 
Last edited:
I don't know why but if doesn't seem to work on the bar or label.
I tested on buttons and it worked. :S
 
it works if the ui have phantom = false, just in case someone wants to know
 
That is because phantom means that mouse movements are sent to widgets on a lower level or below the actual widget.
 
Back
Top