upbge
upbge copied to clipboard
mouseOverAny() callback [feature request long term]
I want to start creating libs to contribute to master, however many of my systems require that I use sensors to avoid polling.
I purpose callbacks for all sensor functions, mouseOverAny() callback movementCallback()
we already have collision
message()
thoughts?
The callback of an event are useful for many purposes. One of them is the creation of gui. I'm agree with that. It's important if you dont want to cover your logic with a lot of "spaghetti" :D
Mouse over any can already be done fully with Python without a Mouse Over Any type sensor.
import bge
bge.logic.mouse.visible = 1
CAM_DEPTH = 128
def main(self):
hitObj = self.owner.getScreenRay(bge.logic.mouse.position[0],bge.logic.mouse.position[1],CAM_DEPTH,"")
print(hitObj)