Why Are My Actors Stacked?

MacTeachMacTeach Member Posts: 11
edited November -1 in Working with GS (Mac)
I have 7 actors (for example) that I want to be like a deck of cards. Each is a copy of one actor with different images. On the stage I've placed them directly on top of each other in a stack so that the next image will appear when the one above is dragged off.
The problem I'm seeing is that they seem to drag as a stack??
Each of them can be dragged individually but not when stacked. Any thoughts?

Comments

  • MacTeachMacTeach Member Posts: 11
    I just wanted to post again on this so I could subscribe via email ;)
  • synthesissynthesis Member Posts: 1,693
    You have to isolate their touches to a unique ID. Buttons in GS are transparent...If the are on top of each other...you are grabbing them all at once and not just the top one. Create a unique ID for each card and a game attribute for the top card's ID and do a test if they match.
  • MacTeachMacTeach Member Posts: 11
    By "ID", I'm assuming you don't mean name? Can you point me in the right direction to "ID?" I pretty new to this...

    Also, how do I create the last selected to be on the top-most layer so it doesn't go underneath other cards?
  • MacTeachMacTeach Member Posts: 11
    Still having this issue - If I drag actor 2 over actor 1 and place them together, they act as one and get 'stuck' together. Not sure how to avoid this!
  • realmadrid1012realmadrid1012 Member Posts: 37
    A position may change
    [url=http://www.withgames.com/Maple-Story-US-Gold.html]buy mesos[/url]
  • MacTeachMacTeach Member Posts: 11
    Can someone PLEASE help me with this??
  • JackBQuickJackBQuick Member Posts: 524
    I'm not sure whether this is the best solution but try something like this:

    Top card (Demo)

    When the stack is clicked, each card sends it's value (e.g. 1, 2, 3, etc.) to a global attribute. Then, the referee actor compares all the cards affected using max(x,y) to find the topmost one.

    As for bringing the last selected card to the topmost layer: when a card is clicked, spawn an identical card in the frontmost layer and then have the clicked card destroy itself. See Spawn Actor and Destroy. You will somehow need to adjust its value to reflect the fact that it is now the topmost card.

    In my demo, you have one actor and seven instances of that actor in the scene. In order to bring the last selected card to the topmost layer, you would need to create and use seven different actors. I'll let you figure out how to do this.
  • JackBQuickJackBQuick Member Posts: 524
    My demo was crashing yesterday because of an overzealous use of constraints :)

    However, I've made some modifications and it seems to work now.
  • MacTeachMacTeach Member Posts: 11
    Nice! I see how you made them separate and not stacked, but it appears that none of them rise up the top most layer. Any workaround?
  • MacTeachMacTeach Member Posts: 11
    I'm going to work on this and keep ya'll posted!
Sign In or Register to comment.