Bring to Front

blendnzjnrblendnzjnr Member Posts: 11
edited December 2011 in Working with GS (Mac)
I have a puzzle game where pieces can be dragged and dropped,
when picking up a piece it increases it's size slightly as if hovering above the other pieces...
the problem is that the stacking of the actors means when you drag a picked up piece it will often move behind other pieces when it should be seen infront. What attribute, or behavior, (or some other way) will allow me to bring the piece that is currently picked up / being dragged to the front ?

Thank you in advance! This is my first GameSalad Game and it's going really well!

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    edited December 2011
    aaahhh .. you have discovered the layer issue! You can't change an actors (puzzle piece) position ... however there is a workaround that would likely work great for you. Basically you are going to have two of the same actor ... puzzle piece .. one in a layer on top and one layer below. The one of top could be sized a little bigger than the back one. Constrain their positions to each other and have a rule when touch is pressed change the back one alpha color to zero and the front ones alpha to 1 (the front one having its alpha as zero to start. Then reverse the alpha on release. You may still have some playing around to do but that is the basic concept. Perhaps if the back actor is not in the right position when it is released it needs to snap back to where it came from otherwise you might have it show stacked when released. Hope that helps.

    EDIT: 'slaps head and reminds self to look thru gshelper.com first :) lol' ... aaah well had good fun practicing my typing!
  • blendnzjnrblendnzjnr Member Posts: 11
    @tshirtbooth Thank-you! I hadn't found that site before - only your YouTube cookbook videos. I guess that's how I'll do it then :)
    BUT... why bother with the extra rule to make the lower one go invisible (alpha 0) - is there any advantage to this (as it won't change what you see) ???

    @simo103 haha good typing thanks so much for bothering! You were pretty spot on according to the video :) - but I must say that's slightly lame you can't change the stack order in a game :/

    Thanks peeps!
    God Bless
Sign In or Register to comment.