MouseUp on GuiTexture seeping to MouseUp on Mesh...

Hiya,

I have some MouseUp methods attached to GOs that are Mesh and have GUITextures (menus) that popup over the GOs with Mesh… Problem is when I capture the MouseUp event on the GUITexture it still seeps through to the GO with the Mesh…

Does anyone have some ideas on how I can block the MouseUp method from being captured by the GO with the Mesh?

Thanks in advance!

– Clint

You could have the MouseUp event check if the mouse is inside any gui Textures using GUIElement.HitTest.

HHHMMM,

Not sure how that resolves my problem, could you provide a bit more information?

Now that I am thinkng about it, I don’t believe I explained my problem well…

What I want to do is make sure that when I click on a GUITexture the mouse event stops there and doesn’t bleed down to the GO but when the GUITexture is not there I want to GO to work as expected.

Thanks!

– Clint

Right. I think what Yoggy meant was to make sure the MouseUp events on the GO check to see if a GUI was hit. If so, don’t do anything. That could solve it.

[edit: added another idea]
Could be a bit of a trick to manage as you add more objects.

Just off the top of my head, you could have a global variable (like usingGUI) that is set to true whenever you mouse over a gui (OnMouseOver()) and make all your GO’s ignore OnMouseUp when it is set to true.

DOH… :sweat_smile:

I’ll give that a try…

Thanks,

– Clint

Okay, so this could work but would be quite a bit of work as I would need to iterate through all the various menu GUIElements that could potentially be on screen in that spot at that time.

Any other ideasor a way to implement that I am missing?

Regards,

– Clint

(You probably missed my edited post above. :smile:)

Just off the top of my head, you could have a global variable (like usingGUI) that is set to true whenever you mouse over a gui (OnMouseOver()) and make all your GO’s ignore OnMouseUp when it is set to true.

I did miss it, sorry about that. :wink:

Actually, that is a good thought and that should be manageable.

Thanks!

– Clint