upbge icon indicating copy to clipboard operation
upbge copied to clipboard

mouseOverAny() callback [feature request long term]

Open BluePrintRandom opened this issue 6 years ago • 2 comments

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?

BluePrintRandom avatar Aug 31 '18 00:08 BluePrintRandom

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

RomStef avatar Aug 31 '18 07:08 RomStef

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)

rpaladin avatar Feb 22 '22 21:02 rpaladin