[SOLVED] Difference placeOnObjectPos and slideToObjectPos
Posted: 07 May 2021, 19:29
Hello.
I am facing a strange behavior.
I have a card that receive a token damage.
When adding this token damage during "normal play" I am using this code in a function named "applydamage" :
In CSS :
The token damage is placed on "top" of the card and with an offset to the left ==> witch is GOOD.
But I have also coded a function for refreshing the page named "setupApplyDamage" :
But now the offsets are applyed from the center of the card.
I have to modify the style to have the token at the right place
Is it normal behavior that these two function does not react the same or am I missing something ... again ? 
NB there is also this topic viewtopic.php?f=12&t=14189&hilit=placeOnObjectPos but I did not linked both problems (for now).
Thank you all ^^
I am facing a strange behavior.
I have a card that receive a token damage.
When adding this token damage during "normal play" I am using this code in a function named "applydamage" :
Code: Select all
dojo.place(this.format_block('jstpl_damage_token', {
damageValue: 3,
cardId: cardId,
tokenIndex: 1
}), 'card_'+cardId,'last');
this.placeOnObject('token_damage_' + cardId+'_1', 'overall_player_board_' + this.getActivePlayerId());
this.slideToObjectPos('token_damage_' + cardId+'_1', 'card_'+cardId,horizontalPosition,verticalPostion).play();Code: Select all
.token-normal-card{
position: relative;
}
.card-elemental {
position: absolute;
}But I have also coded a function for refreshing the page named "setupApplyDamage" :
Code: Select all
dojo.place(this.format_block('jstpl_damage_token', {
damageValue: 3,
cardId: cardId,
tokenIndex: 1
}), 'card_' + cardId, 'last');
this.placeOnObjectPos('token_damage_' + cardId + '_1', 'card_' + cardId, horizontalPosition, verticalPostion);I have to modify the style to have the token at the right place
Code: Select all
dojo.style('token_damage_' + cardId + '_1',topOrBottom, verticalPosition + 'px');
dojo.style('token_damage_' + cardId + '_1','left', horizontalPosition + 'px');NB there is also this topic viewtopic.php?f=12&t=14189&hilit=placeOnObjectPos but I did not linked both problems (for now).
Thank you all ^^