My Token moves to 12px 1979.9px?

Game development with Board Game Arena Studio
Post Reply
User avatar
Wueffi
Posts: 4
Joined: 12 February 2023, 10:54

My Token moves to 12px 1979.9px?

Post 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?
User avatar
paramesis
Posts: 398
Joined: 28 April 2020, 05:00

Re: My Token moves to 12px 1979.9px?

Post 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.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: My Token moves to 12px 1979.9px?

Post by RicardoRix »

or you can take away the transform effect, call the animation.play() and then reapply the transform.
User avatar
Shazzypaz
Posts: 98
Joined: 27 December 2020, 15:22

Re: My Token moves to 12px 1979.9px?

Post by Shazzypaz »

I had objects sliding off the screen when the position attribute was set incorrectly - relative vs absolute.
User avatar
Wueffi
Posts: 4
Joined: 12 February 2023, 10:54

Re: My Token moves to 12px 1979.9px?

Post 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
Post Reply

Return to “Developers”