Custom GUI Controls

Greetings, and welcome to the forum! I hope that you find your time here to be positive! :slight_smile:

So, to address your questions:

Ultimately, this is up to you–up to whether you want to customise the controls, whether you want to spend the time and other resources on doing so, and so on.

The short version is that it’s largely done via parameters provided to the various widgets, which should be found listed in the manual, here:
https://docs.panda3d.org/1.10/python/programming/gui/directgui/index

(Note that the pages for the various widgets I believe only list those parameters specific to those widgets, with parameters introduced by parent-classes being listed in full on the pages for those classes (or the main page covering DirectGUI. So, for example, a DirectButton accepts a variety of parameters specific to DirectButton–but also accepts parameters specific to its parent-class, DirectFrame.)

That’s the usual way, indeed. I think that the manual has short sample-code examples on the pages for the various widgets.

However, there is an alternative: a community-member created a tool called “DirectGUI Designer” which might make life easier:

(Although let me note that I haven’t used it myself, and so am not in a position to speak to its quality one way or another.)

You don’t need to reparent your models to aspect2d should you desire to do this, I believe: you can use various tools provided by the engine (such as the collision system) to determine what the mouse is being pointed at, how it has been moved, and to then update the state of the models accordingly.

For an example, see the manual’s section on “Clicking on 3D Objects” (which should be linked-to below).
https://docs.panda3d.org/1.10/python/programming/collision-detection/clicking-on-3d-objects

(That said, I don’t recommend in general that one have the ray collide with visible geometry, as that example does by its use of “GeomNode.getDefaultCollideMask”–for scenes and objects that aren’t simple, doing so can impact performance I believe. Instead, I generally suggest the use of dedicated collision geometry.

Of course, if your scene is very simple, then colliding with visible geometry may well work for you!)