Log in

View Full Version : onMouseOver naming :P



Visvalor
December 3rd, 2009, 23:16
Looking through the FG tutorial stuff and looking through the coding of the random rulesets I have access too and I can't seem to figure out how to name a numberfield/control with an onMouseOver style event like you have in the buttons at the top right

Looking through the code I see basedesktop.lua and it lists the name for the onMouseOver event , for example

DesktopManager.registerStackShortcut("button_pointer", "button_pointer_down", "Colors", "pointerselection");


"Colors" is the text displayed... how does one attach an onMouseOver "text" to a generic control or any other object?

Tenian
December 3rd, 2009, 23:36
You mean a tooltip? That's the generic term for the text displayed on mouse over.

https://www.fantasygrounds.com/refdoc/windowcontrol.xcp

Might help.

Visvalor
December 4th, 2009, 01:38
Will this work :P?

<script>
function onHover( true )
setTooltipText( Head )
end
</script>

Visvalor
December 4th, 2009, 01:46
Nope that didn't work :P!

This did!


<script>
function onHover()
setTooltipText("Head");
end
</script>

Foen
December 4th, 2009, 06:12
You could also include the tooltip in the control definition (rather than the onHover script) if you don't need it to change during play:


<numbercontrol name='mycontrol'>
...
<tooltip>
<text>Head</text>
</tooltip>
...
</numbercontrol>

Foen

Visvalor
December 4th, 2009, 06:14
Ahh lol... your way is a lot simpler :P