So, I have few questions…
whenever I want to use base.win.getPointer(), I have to put 0 inside the parameter. Does anyone know why you have to put 0?
This code is from here. (youtube.com/watch?v=pKhmXZ9Aejg)
def mouseUpdate(self,task): md = base.win.getPointer(0) x = md.getX() y = md.getY() if base.win.movePointer(0, base.win.getXSize()/2, base.win.getYSize()/2): self.node.setH(self.node.getH() - (x - base.win.getXSize()/2)*0.3) self.node.setP(self.node.getP() - (y - base.win.getYSize()/2)*0.3) return task.cont
(self.node is just a nodepath that is child to the camera.)
My questions is, I don’t understand this line
if base.win.movePointer(0, base.win.getXSize()/2, base.win.getYSize()/2):
Why is this working? I don’t understand why ‘if’ statement is used with base.win.movePointer…
and why do you put 0?