I’m getting a weird problem here. I have an input class that monitors input and listens for events. One of the primary functions here is to figure out how to interpret mouse clicks so I have event-functions for left-click down, left-click up, etc. etc.
I also have buttons that need to be in the environment. When I select an object in the 3D (render scenegraph) space, I have functions that load up specific buttons on the screen related to that object. The problem that I’m having is that when I click a directbutton in the 2D scene graph (parented to render2d) the global input class is interpreting the left-click-up as a deselect command in the 3D environment.
Basically “suppressMouse = True” isn’t working and I have no idea why.
Here’s the code for the button creation:
methodname = '_icon' + str(count)
method = getattr(self,methodname)
buttonmap = loader.loadModel('models/Overlay/'+item+'/model.egg')
icon = DirectButton(geom = (buttonmap.find('**/native'), buttonmap.find('**/rollover'), buttonmap.find('**/clicked'), buttonmap.find('**/disabled')), borderWidth = (0,0), frameColor = (0,0,0,0), rolloverSound = None, clickSound = None, scale = .2, command = method, suppressMouse = True, pos = (base.camLens.getAspectRatio()*.1*count,0,-.75))
icon.reparentTo(prime2d)