Square DirectButton not wanted

Hi everyone,

I’m trying to make a button with DirectButton with 3 images.

I follow every steps in the documentation.

1.I created the 3 images (normal, rollover, clicked) with power of 2. My images are 256x64.
2. I create a .egg card with the good dimension.
3. I load my button like this:

self.test = loader.loadModel("models/buttonNewGame.egg")
            b = DirectButton(geom = (self.test.find('**/normal'),
                         self.test.find('**/clicked'),
                         self.test.find('**/rollover'),
                         self.test.find('**/normal')), pressEffect=None, relief = None)
  1. When I execute the code, all the state of the button are working, the click and everything but the button is square so my textures are badly scaled because of this.

I tryed to change the button size with frameSize but the button stops to work and it doesn’t change the size.

I pass a couple of hours on this so if someone can help me just to show a button with my texture in the correct size, I would be so happy!!

If you want more information, or you want the file or screenshot, just ask.!

Thanks!
Jaff

i just ask! gmmi source luke!

i think the reason is that you created your egg file one way and the button out sizing works for the button only the geom you put there has its own thing about sizes. My guess your egg file is wrong.

I bet when running egg-texture-cards, you used -p 256,64.
Don’t do it !
Do it as in the manual : -p 256,256

Hi!

Thanks for your answer!

You were right!

And that was exactly because I specify 256, 64. So I try again with 256, 256 and it works!

Thanks a lot folks!

Jaff