Having a way to layer objects in the same physical space but each with a different "mouse opacity layer" so that they take mouse events at different priority.
Example:
Object A with mouse_layer = 2 would take mouse events over Object B occupying the same physical space with mouse_layer = 1.
This issue doesn't crop up very often in top-down perspective, but in the isometric diamond there are some use cases where clickable objects occupy the same physical space and things get messy.
ID:2540465
Jan 28 2020, 1:34 pm
|
|||||||
| |||||||
Jan 29 2020, 10:31 am
|
|
Without understanding the situation better, like a use case where this would come up, I'm a bit confused. Also I think you're confusing physical space with visual space here. But it seems to me there should be a way to approach this already.
|
If there's a way to approach this already, that's great.
I run into this when objects are visually underneath another clickable object (e.g, a tree). We want that object to render underneath like it is already, but to the mouse, it takes all the mouse events instead. |
In response to Crazah
|
|
mouse_opacity=0 on the tree?
|
In response to NSBR
|
|
Maybe I need to break this down further to specific use-cases I've run into in my project. A monster walks underneath a tree. The tree is clickable as users can gather things from trees. The monster is hoverable/clickable as well. The monster should have mouse precedence.
Similarly, a player walks underneath a clickable tree, drops an item. That item can never be picked up by players because it's hidden underneath another clickable object. |
#define TOUCH_PLANE 10000 513 is obscenely good. INHERIT_ID will make the mouse interact with the origin INHERIT_ICON will make it mirror the icon. INHERIT_ICON_STATE is obvious. INHERIT_DIR is also obvious. INHERIT_LAYER is also obvious. The important bit here is that atoms with alpha of 0 will still act mouse aware without being visible. So we're just creating a special super-layer for objects that should appear in front of terrain. |