In the code below, an OnscreenImage is placed on the boarder of the screen, the user is allowed to toggle full screen, and a line at the end of the full-screen toggling function repositions the OnscreenImage so that it should be held in the same position. However, it seems that toggling full screen is somehow changing the render 2d coordinate system so that (-1,0,0) no longer correctly refers to the left edge of the screen. I’m currently running Ubuntu Jaunty with Panda 1.6.2, and everything seems to work fine (i.e. I couldn’t reproduce the bug) in Mac OS X. Has anyone seen this before? Anyone know a work around?
Thanks!
import sys
from pandac.PandaModules import *
from direct.gui.OnscreenText import OnscreenText
import direct.directbase.DirectStart
from pandac.PandaModules import ConfigVariableBool
from direct.gui.OnscreenImage import OnscreenImage
def changeFullScreen():
if (not fs):
fs.setValue(1)
else:
fs.setValue(0)
base.openMainWindow()
image.setPos(render2d,-1,0,0 )
fs = ConfigVariableBool("fullscreen")
image = OnscreenImage(image = 'stop.png')
image.setScale(.1)
image.setPos(render2d,-1,0,0 )
base.accept('f', changeFullScreen)
run()
On startup:
After fullscreen:
After closing fullscreen:
Edit
A permanent link to the images: mcstrother.p3dp.com/fullscreenProblem.zip