the problem is that when i load the GUI or resize it the items are using the aspect radio of the main Window. e.g I load a button as a square but it is scaled according to the apsect radio of the GUI .
How can I set a fixed size of all the items in the menu independent from the size or aspect radio of theGUI.
I am not a Panda3D expert, so don’t take my word for it.
But the way you set aspect2d up looks weird, you don’t have to create a node for it, you just reparent buttons to aspect2d. Actually that reparenting happens automatically upon creation of the DirectButtons. I guess in your case aspect2d has it’s own aspect ration that propagates down to nodes reparented to it.
To create your behaviour on purpose, one would do something like:
I see that you are creating a separate window from the main window automatically created by Panda, and you are creating your own render2d and aspect2d to go along with it. That’s all fine, but you should understand that one of the purposes of aspect2d is to include the appropriate scale to counter-scale for the window’s aspect ratio (hence its name).
Panda does this automatically when it creates the global aspect2d for the main window. Since you are creating your own aspect2d, you will have to do it yourself. At the moment, you are explicitly setting the scale on your own aspect2d to (1, 1, 1), which is no scale at all. You should set it to something like (1.333, 1, 1) to counter-scale a 4:3 window.