dojo placeOnObject & slideToObject limitation

Game development with Board Game Arena Studio
Post Reply
Cowseye
Posts: 26
Joined: 11 August 2013, 17:33

dojo placeOnObject & slideToObject limitation

Post by Cowseye »

Hi all,

I would like to check if this is an expected behavior:

I have a jstpl created token (A meeple for instance) that needs to be place (or slide) onto another jstpl created token (A randomly placed tile as a holder for meeples). This can be done as part of an onClick event. However, the token flew somewhere else unexpected when this is done during the setup function called during a refresh of the page. I had checked all variables passed for the meeple token to placeOnObject or slideToObject are referring to the correct tile.

Is this normal? What am I missing? Is it not possible to place or slide jstpl objects onto another during setup? I tried to rework my code place on space holder define in game.view.php and that works.
User avatar
Andy_K
Posts: 51
Joined: 13 February 2014, 15:59

Re: dojo placeOnObject & slideToObject limitation

Post by Andy_K »

I suspect that your holder token hasn't finished moving by the time you attempt to slide your meeple token onto it, therefore the animation gets the wrong coordinates and your token goes astray.

You could either chain the animations, put a delay on, or else place the token on an object already defined in the view as you've already discovered.
User avatar
Morgalad
Posts: 108
Joined: 17 January 2017, 20:46
Contact:

Re: dojo placeOnObject & slideToObject limitation

Post by Morgalad »

also check that both objects have position absolute.
Cheers...
Morgalad

Developer of: Incan Gold , Takara Island , Taluva and Veggie Garden
Cowseye
Posts: 26
Joined: 11 August 2013, 17:33

Re: dojo placeOnObject & slideToObject limitation

Post by Cowseye »

Thanks! Let me look at the tutorial for the chaining of animation!
All my objects have absolute position.
Cowseye
Posts: 26
Joined: 11 August 2013, 17:33

Re: dojo placeOnObject & slideToObject limitation

Post by Cowseye »

A quick edit of my code to use placeOnObject for the jstpl holder works!
Didn't know this may caused problems. Thank you Andy_K and Morgalad for your quick response!
User avatar
Morgalad
Posts: 108
Joined: 17 January 2017, 20:46
Contact:

Re: dojo placeOnObject & slideToObject limitation

Post by Morgalad »

Cowseye wrote:A quick edit of my code to use placeOnObject for the jstpl holder works!
Didn't know this may caused problems. Thank you Andy_K and Morgalad for your quick response!
YW!

That's why we are here... to help each others... aren't we? ;)
Cheers...
Morgalad

Developer of: Incan Gold , Takara Island , Taluva and Veggie Garden
Post Reply

Return to “Developers”