Why Are My Actors Stacked?
MacTeach
Member Posts: 11
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?
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
Also, how do I create the last selected to be on the top-most layer so it doesn't go underneath other cards?
[url=http://www.withgames.com/Maple-Story-US-Gold.html]buy mesos[/url]
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.
However, I've made some modifications and it seems to work now.
[url=http://www.withgames.com/Maple-Story-US-Gold.html]maplestory meso[/url]
[url=http://www.withgames.com/Maple-Story-US-Gold.html]buy mesos[/url]