One actor more important then the other one
IsabelleK
Member, Sous Chef Posts: 2,807
Hello again,
I have two layers in my game, one is scrollable, and second is not scrollable. On the non scrollable I have a HUD with few buttons (main menu, save etc.). But sometimes, when first layer is scrolling, then actors from it (which are clickable) are behind HUD buttons.
In this situation when player is clicking on the HUD button, then two actions occurs (action from the HUD button, and action from an actor behind).
The HUD buttons (actors) should be more important, so in situation I mentioned, there should occur only action from the HUD button.
Is there a way to make one actor more important then the other one, or maybe a way to make actor inctive when he is under the HUD buttons? Or some other way to solve this problem?
I've hope that I explained it properly.
I have two layers in my game, one is scrollable, and second is not scrollable. On the non scrollable I have a HUD with few buttons (main menu, save etc.). But sometimes, when first layer is scrolling, then actors from it (which are clickable) are behind HUD buttons.
In this situation when player is clicking on the HUD button, then two actions occurs (action from the HUD button, and action from an actor behind).
The HUD buttons (actors) should be more important, so in situation I mentioned, there should occur only action from the HUD button.
Is there a way to make one actor more important then the other one, or maybe a way to make actor inctive when he is under the HUD buttons? Or some other way to solve this problem?
I've hope that I explained it properly.
Comments
I was thinking about few solutions:
1. Make a HUD buttons colliding with clickable actors on the scrollable layer. But each of them is passive (they don't move).
2. Make a rule, which will make actors on scrollable layer inactive, when camera position is XXXX. When camera position will be on XXXXX then boolean attribute will change to false. And this clickable actor will demands touch it and this boolean attribute to be true.
What do you think? This will work? Or maybe you have other ideas?
Thank you.
EDIT: Or maybe I'll ask in other way: two actors are in the same place on the screen (one is behind other one). Both of them are clickable. When player touch it, then two actions occurs. How to make one actor more important, or maybe other one inactive, when he is behind the other one?
if on screen actor overlaps or collides with hud actor change "canBeTouched" to false otherwise canBeTouched to true.
If touch is pressed and canBeTouched is true do .....
Darren.
That works great, my problem is that I want the overlapping actors to work but not all at the same time. So there are two actors, one is smaller than the other and it's above the other layer, how can I select the smaller one without selecting the larger one too?
Darren.
Think i got it, not 100% sure what you want but have 2 actors on different layers and if small is overlapping big you can only move small, you can move big when small is not overlapping.
Darren.