I am working on a GUI, and the Direct button is giving me some headaches…
Here http://screencast.com/t/wPTErjrZ, i have a simple attempt of usage of DirectButton, thanks Thomas i have no ugly gray box , but that rollover effect, which is causing distortion (in the width of button and also the word), still bothers me, in a near future i intend to simple change colors through out the states.
If you set an explicit state for your rollover effect with the multiple-state form of geom, text, and/or texture option, then it won’t scale the button. It only scales them when you give it a single-state form, so in that case it has to synthesize the rollover effect internally by applying a scale.
This looks something like:
b = DirectButton(geom = (geom0, geom1, geom2, geom3))
where geom0, geom1, geom2, geom3 are four different NodePaths, which show what the button should look like in the ready, clicked, rollover, and disabled state, respectively.
Hmm, so far unable to reproduce. I try your code with my own textures, and I observe no visible distortion.
So, OK, please send me your files, and I’ll see what it looks like with your textures. Are you sure the distortion you’re observing isn’t something intrinsic in the textures themselves?
shoot! Yeah David, you were right! the rollover texture was in a different size… and i didn’t realized that, thanks for the help, and i’m sorry for bothering you.