RonenNess / GeonBit.UI

UI system for MonoGame projects.
MIT License
477 stars 64 forks source link

Preventing in-game click fall through GenoBit.UI entities #128

Closed dclipca closed 2 years ago

dclipca commented 2 years ago

Wondering how to do it. The ClickThrough property works for GenoBit.UI entities only.

RonenNess commented 2 years ago

Not sure I understand what you mean, do you have UI behind your game rendering?

dclipca commented 2 years ago

Not sure I understand what you mean, do you have UI behind your game rendering?

No I mean preventing "falling through " into game rendering. I imagine it might work by checking if a click is inside an entity and if it is, then don't propagate it into the game rendering.

RonenNess commented 2 years ago

Ah yes, that's the way I usually do it. There's a member that keeps the entity you currently point on / interact with, iirc its ActiveEntity or something like that (not on a PC right now)

dclipca commented 2 years ago

Ah yes, that's the way I usually do it. There's a member that keeps the entity you currently point on / interact with, iirc its ActiveEntity or something like that (not on a PC right now)

Thank you very much for your input. Also I have to say this library is wonderful. The best Monogame UI framework all around. Your rock!

By the way, would you mind checking this issue? Essentially it's about detecting entities based on their position on the screen (for the purposes of handling drag-and-dropping).