Using screens with different aspect ratios

If i was going to run my game on a display with a panoramic aspect ratio it would not play very well right? Because aspect2d is setup for 4/3.

Is there a quick hack to solve this problem?

In another thread i made “The way aspect2d is setup” i have some code that could change things but the design of the gui classes in Panda3D is very complex and i’m not sure if a kick hack would solve anything.

base.camLens.setAspectRatio(3.0/4.0)

Try also setting the FOV of the camera.
[size=75](source: this thread)[/size]

Actually, I believe aspect2d is designed to set itself up to match whatever aspect window you open by default.

David

drwr, not in all cases, If you set up your own displayRegions. You must set the aspect ratio back to 3:4 otherwise things will look stretched

So in the case where we have an unusual aspect ratio and we cannot know in advance what it is how do we obtain the width and height of the current display from aspect2d?

Preferably this would be done inside an event handler once the window is visible for the first time or after the window configuration was changed by the user (in case the game isn’t playing in fullscreen and the user changed the window shape).

Try reading this thread and this thread.

David

That was useful, thanks.