I’ve been making an image, of course, using onScreenImage. This isn’t a problem for me at all.
However, No matter what image I set,
It will take the actual shape, and distort it to a perfect square.
This isn’t what I want, I was making a rectangle to make a “Start Screen Button” if you concider.
But I didn’t want to use the actual button method.
So i’m not looking for a “You can just make a button like doing this:” Sort of thing,
I just want to know how to make an onScreenImage not distor my actual image shape.
Dang whatsup with all that “Buy my stuff!” Spam?
Anywho, anyone know a way I can make it so it doesn’t distort my image?
You can set a specific size with something like scale = (1.333, 1, 1) on the OnscreenImage constructor. The three parameters are sx, sy, sz, where sx and sz control the size of the image in the horizontal and vertical axis. You should always pass sy = 1 (the y axis isn’t used in 2-D images).
Or, if you just want to make it the same aspect ratio as the original source image, the easiest way is to use the egg-texture-cards command-line tool, as described in the manual. Something like this:
egg-texture-cards -p 512,512 -o mycard.egg mytex.png
And then display this in your Python code with something like:
mycard = loader.loadModel('mycard.egg')
oi = OnscreenImage(image = mycard)