One actor more important then the other one

IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
edited November -1 in Working with GS (Mac)
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.

Comments

  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    Hello again, in reference to my previous post - maybe you have some ideas?
    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?
  • UtopianGamesUtopianGames Member Posts: 5,692
    If you have a rule for your on screen actors and you don't want it to work if your behind your HUD actors do something like...

    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.
  • GamersRejoiceGamersRejoice Member Posts: 817
    Thanks 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?
  • UtopianGamesUtopianGames Member Posts: 5,692
    Let me try and do a quick template for you.

    Darren.
  • GamersRejoiceGamersRejoice Member Posts: 817
    You're the best!
  • UtopianGamesUtopianGames Member Posts: 5,692
    pop me a mail over to toyboxuk[at]hotmail.com

    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.
  • GamersRejoiceGamersRejoice Member Posts: 817
    Thank you so much making me that demo, it helped me understand it and get it working! I was pulling my hair out trying to get this to work!
Sign In or Register to comment.