How to Position/scale a directframe

How can I set a position/size of directframe, lets suppose I want a frame that cover 1/4 of the width of the screen and all height, don’t matter the size of the screen and he keep with this relation doesn’t matter how much I resize the window, is it possible or should I return to opengl or migrate to vulkan?

Hi! I don’t think that it is supported ootb, anyway you have all you need for adding this straightly. You can listen for the event window-event, and resize the frame in the callback.

Actually it is supported :slight_smile: You can reparent your direct frame to either aspect2d or render2d, depending if you want to keep your aspect ratio or not, see https://docs.panda3d.org/1.10/python/programming/scene-graph/scene-graph-manipulations

A frame covering all height and only the left 1/4 of the screen would have (-1, 0, 1) as upper left corner and (-0.75, 0, -1) as lower right corner.

2 Likes