Wanted to animate a token grabbed when pressing an action button.
Couldn't find any example, so here is my solution:
My template
Couldn't find any example, so here is my solution:
Code: Select all
let tokenId = `slidingToken_${this.uniqueId++}`;
dojo.place( this.format_block( 'jstpl_token',
{
id: tokenId,
} ) , "left-side");
this.placeOnObject( tokenId, 'pick_branchtoken');
let playerBoardLocation = "playerboard_icon_p" + notif.args.player_id;
let slide = this.slideToObject(tokenId, playerBoardLocation, 700);
var parent = this;
dojo.connect( slide, 'onEnd',
function()
{
dojo.destroy(tokenId);
parent.visualRefreshPlayerBoards();
}
);
slide.play();
Code: Select all
var jstpl_token='<div id="${id}" class="branchicon" style="position: absolute; z-index: 5;"></div>';