GUI - Display images at constant size

How can I display GUI objects like OnscreenImage at a consistent size regardless of window size? I have some images that I do not wish to scale at all with the window - and objects that I only want to scale in the horizontal or vertical with the window.

Thanks.

Specify parent=render2d in the constructor (or use reparentTo after the fact).

If you really want it to be consistent with pixel-for-pixel sizes, and not scale with the window at all, you should parent it to pixel2d (and in this case, the scale values for your object should be in pixels, not in fractions of the window size).

David

When using pixel2d, keep in mind that positions are in the format (X, 0, -Y) due to the coordinate system that Panda uses.

pixel2D did the trick. Thanks. Going through the manual and a book somehow I never came upon the reference to pixel2d…I didn’t even realize it existed.