Animating a move from one Stock to another

Game development with Board Game Arena Studio
Post Reply
sparr
Posts: 65
Joined: 08 April 2014, 02:12

Animating a move from one Stock to another

Post by sparr » 16 December 2014, 03:52

Code: Select all

                this.currentcanvas.removeFromStockById( card.id );
                this.previouscanvas.addToStockWithId( card.type , card.id, 'currentcanvas' );
I'm moving a card from currentcanvas to previouscanvas. I'd love to have the "from" parameter on the second call be the precise location the card is coming from, rather than the center of the whole currentcanvas element. How can I make this work? I get an error if I try to spawn the new card before destroying the old one, and with the old one gone I can't properly target the source of the sliding animation.

User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

Re: Animating a move from one Stock to another

Post by pikiou » 25 December 2014, 05:11

You should't get the first error you mentioned. Do your stocks have a different html id?

sparr
Posts: 65
Joined: 08 April 2014, 02:12

Re: Animating a move from one Stock to another

Post by sparr » 25 December 2014, 21:15

I must have been doing something wrong before. It works fine now, and all my animations are now starting/ending where they belong.

Post Reply

Return to “Developers”