I’ve encountered an issue in version 1.10: when the window’s size is changed, 2D elements seem to stretch with it, rather than retaining their previous aspect ratios. I think that all affected elements are parented beneath “aspect2d”. (I would expect such stretching if they were under “render2d”.)
It looks almost as though “aspect2d”'s scale isn’t being changed to reflect the window’s new aspect ratio. o_0
For reference, I’m changing the window’s size by creating a “WindowProperties” object, setting the appropriate size (along with a few other properties) in that, and then calling “base.win.requestProperties”, passing in the “WindowProperties” object. Like so:
# "xSize" and "ySize" compose the requested window-size wp = WindowProperties() wp.setSize(xSize, ySize) wp.setFullscreen(self.fullscreenMode) wp.setCursorFilename(CURSOR_FILE) base.win.requestProperties(wp) # More code then follows to handle various other matters that # should be handled in response to the change, such as the # rendered FOV.
it may be worth noting that this happens after another call to “base.win.requestProperties”, in which I set the window to not be in fullscreen; I think that I found that I had trouble setting the resolution while in fullscreen mode. The full process then looks like this:
def setResolution(self): self.updatingResolution = True wp = WindowProperties() wp.setFullscreen(False) wp.setCursorFilename(CURSOR_FILE) base.win.requestProperties(wp) taskMgr.doMethodLater(0.1, self.setResolutionInternal, "reset resolution", extraArgs=) def setResolutionInternal(self): # This simply fetches the desired resolution xSize, ySize = OPTION_RESOLUTION_LIST[self.resolutionIndex] self.setOption(OPTION_GRAPHICS_RESOLUTION, self.resolutionIndex) # The size-setting code, as before wp = WindowProperties() wp.setSize(xSize, ySize) wp.setFullscreen(self.fullscreenMode) wp.setCursorFilename(CURSOR_FILE) base.win.requestProperties(wp) # Once again, more code follows here...
(This issue didn’t occur in 1.9.4, I believe.)