I would suggest using pixel2d as the root of all gui elements. I imagine that sooner or later you will want to put some textures on the buttons and/or have the text crisp-sharp - in that case pixel2d is the way to go.
If you use pixel2d then you need to resize all the texts (scale =1.0 if 1 pixel). Some DGui (sliders, scrollbars) elements will have parts smaller then 1 pixel using the default setting, you may need to experiment with the settings to get something visible on the screen in some cases.
Also the coordinates of pixel2d are a bit …em… specific
Y _ /\
| \ |
| SCREEN |
When using pixel2d I alway use these helper functions:
def _rec2d(width, height):
return (-width, 0, 0, height)
frame.setPos(-size, 0, -size)
So to make a frame that is 127pixels width 13 pixels high, and position it 20pixels from the left edge and 60 pixels from the top edge you’d do:
_resetPivot can break some compound elements, but I don’t have a list of what exactly.
EDIT: I think I got the axis wrong myself on the first go, should be more correct now