So I’m working on making a game and I want to hide the mouse cursor. I looked it up on the forum and people said use this code snip-it:
props = WindowProperties()
It gives the error:
Traceback (most recent call last):
file “panda3.py”, line 195, in (module)
app = MyApp()
File “panda3d.py”, line 40, in init
props = Window Properties()
NameError: global name ‘WindowProperties’ is not defined
I have a windows 7 computer and am using python 2.7
help would be much appreciated.
You haven’t imported WindowProperties, so python doesn’t know what it is. Most of the time when you see a reference to some panda object without an import call, it’s in panda3d.core. I think most people just call from panda3d.core import * at the top of everything so they can use these objects without importing them by name.
Thank you so much for the quick reply, but It gave me a different error when I tried “from panda3d.core import *”
Import Error: No module named core
I’m using python 2.7 if that matters at all, and if it does is there a way to do it in python 2.7
again thanks for all the help
Would you please show us what you have at the top of the file – your “import” statements?
Do you have a file called “panda3d.py” in your current working directory? If so, rename it, as it will conflict with the Panda3D installation.
That was it!
For the lack of a better name I had named the game “panda3d.py”
I changed the name and deleted the old one and it worked great
Thanks for all the quick help!