DirectGui transparency issue

Hi,

I am making a gui for a game using directGui. I am using egg texture cards. The textures used are png images.
I am drawing the gui on top of a background image. The gui elements are DirectButtons.
My issue is that part of the border on the png image shows in the scene as a thin grey line that was supposed to be transparent. The parts of the geom that should be transparent are transparent, it is just that it seems you can see a thin border where the image border should be that remains grey instead being transparent.
I have tried playing with sorting order, transparency attributes etc… nothing seems to fix it.
when i start panda in windowed mode it does not show, when i maximize the window it shows. in fullscreen it shows.
It seems to happen with DirectX9 much more than with pandagl. I have to used pandadx9 for other reasons though.
Anyone had this problem before? any ideas on how to fix that?

Thank you
lebdev

I solved the issue by increasing the scale of the button to 1.04 instead of 1.
Not sure what the problem was but it got solved this way.
Any ideas why?

thanks
lebdev

Perhaps the previous scaling resulted in a transparent pixel and an opaque pixel sharing a screen pixel, resulting in a blend of the two for that screen pixel.

It is possible but it found it strange that it would happen on exactly all the buttons around where the border of the image was supposed to be.

Another question related to direct button. Does it not take a frameSize argument? Setting a frameSize does not seem to alter the button bounds in button.getBounds().
Neither does the scale affect the bounds it seems. Even though the button is visibly larger, the getBounds() function returns the same numbers.
I have relief set to None, are these to set the relief size maybe?

Thanks
Lebdev

With regards to construction, I think that the frame size may be calculated automatically; I’m not sure of whether there’s a way to override this.

As to scaling, have you tried calling “resetFrameSize” after you scale the button?

Something like this:

# Presume that "myButton" is a button created earlier
myButton.setScale(5.0)
myButton.resetFrameSize()

That sounds like the issue described at the bottom of this manual page.
Have you already tried setting the wrap mode of the texture to WMClamp? See this thread for more info.

Thanks, i will try that.

LebDev

How do i apply that to a geom texture? i load the texture through an egg file.

VC

Like drwr said in the thread I linked to: add the parameter “-wm clamp” to your call to egg-texture-cards;
it looks like this when applied to the DirectButton example given in the manual:

egg-texture-cards -wm clamp -o button_maps.egg -p 240,240 button_ready.png button_click.png button_rollover.png button_disabled.png

great thank you for the information.

Lebdev