Slide to position after last item of player_board

Game development with Board Game Arena Studio
Post Reply
User avatar
Bids
Posts: 72
Joined: 02 April 2019, 18:10

Slide to position after last item of player_board

Post by Bids »

Hi,
I'm wondering why my object does not end up in the same positon when doing

Code: Select all

dojo.place( this.format_block('jstpl_cardwon',{player_id : player_id, turn : turn_id, x : 300}), 'player_board_' + player_id);
vs

Code: Select all

this.placeOnObject('cardwon_' + player_id + '_' + turn_id, 'player_board_' + player_id);


With the first dojo.place it's placed after the last item in player_board, that makes sense to me. But with the second one it's place somewhere in the middle of the player_board, because I imagine like placeOnObject says, it places it just on the object 'player_board';

So what's the most elegant way to slide it to position after the last item in player_board?

Thanks a lot for your help!
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Slide to position after last item of player_board

Post by Tisaac »

Most elegant would be to create a phantom div with same size that you place with dojo and use slide to this object and hook up end of animation to replace phantom div by the one that slided
User avatar
Bids
Posts: 72
Joined: 02 April 2019, 18:10

Re: Slide to position after last item of player_board

Post by Bids »

I was thinking of that option but I was hoping that would not be the 'most elegant' way. Many thanks for your answer!
Post Reply

Return to “Developers”