Help With DirectGui

Greetings! =)

I’m somewhat new to panda3d and I’m having a lot of trouble to create what I want to my game.
I want to create an interface which is a fixed menu that will stay all the time in the bottom of the screen… with some buttons, labels, textboxs and etc… So I created a DirectFrame to parent all these others directgui objects to it, and I don’t know if I’m doing something wrong, but it isn’t working!
Anyone can tell mo how do I do it?
I thought that when I create this:

self.frame_main = DirectFrame(scale = 0.1,
relief = GROOVE,
frameSize = (-15, 15, -5, -10),
frameColor = (200, 200, 200, 0.5), parent=render2d)

and then this

self.button_1 = DirectButton(self.frame_main,text=“Teste”,scale=0.5,pos=(0,0,0))

the button shold appear inside the frame, with is pos relative to the frame, but it seems id doesn’t work that way.
And if I set the pos of the button to stay together with the frame, it appears behind it…

Anyone can help me? It’s a little urgent! :cry:

Thanks a lot!

This is the orientation of render2D :
= X+ is to the right
= Y+ is going forward
= Z+ is going up
So, you can set the Y of the button with smaller number than the frame’s.
And the RGB color in Panda is clamped from 0 to 1.
(0,0,0) is pure black and (1,1,1) is bright white.

Ok, Thanks.

But how do I parent a button or any other directObject to a frame? So that it’ll only appear inside that frame?

“parenting” an object to a frame doesn’t constrain it to the frame, but it does inherit the frame’s origin–that is, an object shares the same (0, 0) point as its parent. In your case, though, since you use frameSize = (-15, 15, -5, -10) to move the visible representation of the frame far away from its origin at (0, 0), instead of something like pos = (0, 0, -7.5) and frameSize = (-15, 15, -2.5, 2.5) to move the whole frame along with its origin, the child doesn’t end up anywhere near the parent frame.