Is there a way to set the pos (or even the transform) on the mouseNode? Poking through the references it seems like this design is purposeful (ie node being called mouseWatcherNode etc)
I am using pygame for the joystick part of my game, but as much as i struggle cant get mouse input to work with it (pygame does have a mouse.set_pos() function).
I am assuming its because i am not using a pygame window, and the fact it returns values relative to that window i create with that api. Thus my dilemma!
Thanks again guys; you guys are always quite helpful.
Is there a reference page i can find the base. stuffs? Or perhaps even just look into the c code itself?
Not sure what you’re asking about there. The only reference page is the “Reference” page, linked above. It contains the comments extracted from the C++ source. Or you can certainly download and read the C++ source directly, which may be a little easier to read than the Reference page, and you can also see what the source is doing.
Oh i mean like i know that base.win exists (as well as base.otherstuffs); but what type of object is it so i can track it down inside of the reference sheet is half of what i was asking.
Worded poorly, I was asking if i could see the attributes of base, along with their types.
I suppose i can just print base or base.win and it will tell me the types of them which will tell me where to go in reference manual, -1 for me .
Is there a way i can print out the class dictionaries in python?
***edit … dir and help, i withdraw my question
*** edit # 2
base.win.movePointer(int device, x, y), where it looks like x,y are in pixels
‘base’ is an instance of the python class ShowBase, which is documented in the API reference. The methods aren’t though, so you need to call dict on it (or use dir(base)).
‘base.win’ is an instance of GraphicsWindow, which is a C++ class but also documented in the APIref.
base.win.movePointer indeed needs pixels. You simply have to do a little calculating to convert screen coordinates into pixels.
But if you need something simple as moving the mouse to the center, you shouldn’t use the mouseWatcher but just calculate it in pixels. You can get the mouse position in pixels by doing base.win.getPointer(0).getX() and getY(). For example, to move the mouse to the center:
base.win.movePointer(0, base.win.getXSize() / 2, base.win.getYSize() / 2)
Like always, thank you pro-rsoft.
Im doing something a bit more complicated with the mouse, but i think i can precalculate all of the locations with the little snippets you gave.