Hello! I have just started using Panda3D a week ago and for the most part find it a joy to use. However, I am at a complete loss to understand how the DirectGUI positioning and scaling works!
In short: I am looking for someone to explain the coordinates and how they are determined (along with scaling).
Here’s some details of why it’s causing me confusion:
I have the window set to 1280x800 in the config prc.
Example 1: OnscreenImage
- I created an image 1280x400, with the top half transparent (PNG).
- If I load it up with scale=1,1,1 it’s half the screen wide and all the screen tall (the non-transparent bottom half takes up the bottom half of the screen instead of the bottom 1/4 that I was expecting)
Example 2: DirectEntry
I am trying to place a DirectEntry widget in the bottom of the screen (so the bottom-left edge of the entry widget is attached to the bottom left corner of the screen) – how?
(Side issue: DirectEntry(pos=(x,y,z)), the pos wants a three-tuple instead of a (x,y) … confusing!
To help myself, I tried outputting the widget positions as I moved it around (I print out str(getPos())).
-
As I move it around the third coord is what moves according to the y-axis? This is like (x, z, y)? But if I set the pos as (-1.0, 0, -1.0), it won’t show where it will if I set it (-1.0, -1.0, 0)
-
I looked in the Python Chat example and the background image is scaled at (1.707, 0, 1.707) while the OnscreenText widgets are scaled at 0.5. How did those values get arrived at?
Basically, as you can probably tell, I hope I am missing the piece to the puzzle that allows me to understand how position and scale and the screen size all fit together. I am just trying to put something XxY in size at position (x,y) on the screen (no stretching, shrinking!)…
Any help would be appreciated. Thanks!