Page 1 of 1

My Token moves to 12px 1979.9px?

Posted: 27 April 2023, 17:09
by Wueffi
So i tried moving a Token to an object with
this.slideToObject('token_' + x + '_' + y, 'slot_' + x + '_' + y).play();
but it does not slide to slot_x_y, it slides to 12px 1979.9px, which is out of my screen.

but if i replace it with
this.PlaceOnObject('token_' + x + '_' + y, 'slot_' + x + '_' + y).play();

it works fine? how can i fix it?

Re: My Token moves to 12px 1979.9px?

Posted: 27 April 2023, 19:12
by paramesis
Are you using CSS transform effects? These are incompatible with SlideTo effects. See
https://en.doc . boardgamearena.com/Game_interface_logic:_yourgamename.js#Dojo_Animations
(remove spaces)

Whenever I need to use a SlideTo animation on objects with transform effects, such as cards in Wingspan, I wrap the transformed object in a div with no CSS transforms, and if I move that outer div, SlideTo works as expected.

Re: My Token moves to 12px 1979.9px?

Posted: 28 April 2023, 09:11
by RicardoRix
or you can take away the transform effect, call the animation.play() and then reapply the transform.

Re: My Token moves to 12px 1979.9px?

Posted: 28 April 2023, 12:10
by Shazzypaz
I had objects sliding off the screen when the position attribute was set incorrectly - relative vs absolute.

Re: My Token moves to 12px 1979.9px?

Posted: 28 April 2023, 19:10
by Wueffi
Shazzypaz wrote: 28 April 2023, 12:10 I had objects sliding off the screen when the position attribute was set incorrectly - relative vs absolute.
Thx it worked