Hello!
I am having problems solving how to use slideTo with some css transform items. As explained in the Animations section of the Game_interface_logic:_yourgamename.js document:
This is the code I have. In the first sentence I remove the scale transform I have on all 'onBoard' element. Then I use the slideToAndDestroy function and in the last sentence, I apply the scale transform again. But the slideToAndDestroy does not move the victoryPointToken to the place is supposed to go, there is an offset as if the scale had not been removed.
I have tried removing the last sentence, which applies the scale transform again, and then the slideToAnddestroy moves the token to the right place. But then I don't have the scale I need on the board.
Could it be that I need to apply the scale transform again after some extra miliseconds, to let the slideTo function more time to calculate properly the div coordinates?
Any help will be greatly appreciated. Thank you in advance!
locerol
I am having problems solving how to use slideTo with some css transform items. As explained in the Animations section of the Game_interface_logic:_yourgamename.js document:
So, the problem I am having is using the disable all css transform properties, slidingTo, and then applying them again solution.Note 2: the slideTo methods are not compatible with CSS transform (scale, zoom, rotate...). If possible, avoid using CSS transform on nodes that are being slided. Eventually, the only possible solution to make these 2 compatible is to disable all CSS transform properties, use slideToObjectPos/placeOnObjectPos, and then apply them again.
This is the code I have. In the first sentence I remove the scale transform I have on all 'onBoard' element. Then I use the slideToAndDestroy function and in the last sentence, I apply the scale transform again. But the slideToAndDestroy does not move the victoryPointToken to the place is supposed to go, there is an offset as if the scale had not been removed.
Code: Select all
dojo.query('.onBoard').style('transform', "");
for (i=0;i<notif.args.numVP2Mod;i++)
{
dojo.place( this.format_block( 'jstpl_victoryPointToken', {
VPTOKENPLAYERID: notif.args.player_id,
VPID:notif.args.tile_id,
INDEX: i
} ) , 'tile_'+notif.args.tile_id);
var delay= i*100;
if (this.player_id!=notif.args.player_id)
{
this.slideToObjectAndDestroy( 'victoryPointToken_'+notif.args.player_id+'_'+notif.args.tile_id+'_'+i, 'overall_player_board_'+notif.args.player_id, 1500, delay);
}
else //if (this.player_id==notif.args.player_id)
{
this.slideToObjectAndDestroy( 'victoryPointToken_'+notif.args.player_id+'_'+notif.args.tile_id+'_'+i, 'vpPictureContainer', 1500, delay);
}
}
dojo.query('.onBoard').style('transform', 'scale('+currentZoomFactor+')'); Could it be that I need to apply the scale transform again after some extra miliseconds, to let the slideTo function more time to calculate properly the div coordinates?
Any help will be greatly appreciated. Thank you in advance!
locerol