Help with ShowBase subclassing: misbehaving aspect ratio

I recently modified my program to subclass the ShowBase class instead of using DirectStart. I now have a problem with the aspect ratio. When the program first starts, the scene looks good, but if I resize the window (a wx window with an on-resize event that gives the "window-event’ event to the messenger), the ratio is wrong - it’s like the scene has been squished or stretched.

Help! Thanks :slight_smile:

The problem may be that you’re using window-event to resize the window. You shouldn’t use this to resize it - instead, use, y)).

Otherwise, perhaps you are overriding a vital method or blocking ShowBase from catching an important event. Which methods are you overriding? Also, you have to make sure that ShowBase can still receive window-event properly to correct the aspect-ratio of the lens.

I believe I was using just that:

width, height = self.panel.GetClientSizeTuple()  # wx panel
props = WindowProperties()
props.setOrigin(0, 0)
props.setSize(width, height)  # self.panda is the subclass of ShowBase
self.panda.messenger.send(, [])

Just init(), and in it I call ShowBase.init(self).

I’m not even catching the “window-event” event.

Found it - I had an instance variable called “cam” which was messing with the actual variable.

Have a good one, thanks.