Well, let’s see if I can help by showing where the important tidbits are.
First off, let’s go over “hovering”
The tonegod.gui.core.Screen class handles all the raw inputs with the
com.jme3.input and com.jme3.input.event libraries (Note: and to subscreens with rays, and collision results… ). It forwards the events on to the various Elements that match various “Listener” criteria.
The Listener for “hovering” is tonegod.gui.listeners.MouseFocusListener. You can look at the code in tonegod.gui.controls.Button to see that when a button receives the focus event, it starts an effect and sound (if sound is enabled) and signals for the effect to stop when it loses focus.
Windows in tonegod don’t naturally have this functionality, but you can extend the class and implement the listener. Also, don’t forget that “dragbar” and “contentArea” can be altered if you wish to target those elements.
Otherwise, just have your game to do stuff with the normal buttons’ onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) method override. You can easily send a quick this.getUID() to somewhere.
and finally, you want the UID of a mouseclicked element, like every single one? Try this:
You will have to extend the Screen class and override the onMouseButtonEvent method. The code will be the same (just copy and paste) but add a String lastElementClickedUID and then set it to eventElement.getUID() somewhere in the if(evt.isReleased()) section under case 0 for left click. I just recommend the isReleased() section because tonegod cued off of that event for recognizing a click. As a bonus, the magic method for actual collision results is: getEventElement(). I’m only suggesting this because you are in the “playing with it” phase of using it.
So to review:
- we can change it at the Button/Window/Element level (with Listeners), yes.
- we can change it at the Screen level (where dispatch happens), yes.
Big tip: It’s not necessary to know the name of what you are clicking on most of the time, it is necessary for whatever you click on to be able do things. As in: If you are needing for a button or element to affect some other button or window… make use of setUID() to uniquely name your stuff during construction/initialization phase. That way… you know how to correctly reference your target, and you are just a Screen.getElementByID or Element.getChildElementByID away from getting things done.
edit: Whoohoo! so… some elements are marked private by the advanced controls (which also have children) so Troll lol no lol access is typically granted… said advanced controls might need tweaking in source, what say?
and… this really isn’t the place for this question (should’ve started a new topic in troubleshooting or something), but whatever