I been having a lot of fun trying to implement Rising Empires. I have run into a bug that I have not been able to find a solution to. When I play my cards they always get a strange position. How do I control the top and left position of the style when I am playing cards? It likes to put my cards here:
<div class="playercard charactercard" id="cardspotx_1" style="background-position: 450px 210px; top: -52.5px; left: 72.5px;"></div>
At top:-52.5px; left: 72.5px;. It will put the cards there for all 30 spots on the gameboard. As soon as I try to play a card that 'kills' another card. Meaning I need to clear out the old card and play another card in it's spot, now it puts the cards right where they are supposed to go without adding that extra offsetting style. So I can't compensate for the weird positioning because when I call the same routine later in the game it stops doing it.
<div class="playercard charactercard" id="cardspotx_1" style="background-position: 450px 210px;"></div>
Nowhere in my code have I told the cards to have the strange positioning. In fact specifying the top and left positions in the playercard or charactercard class or specifying them in the Javascript template are all ignored and it just puts it where it wants. I need a way to control this so my positioning is always consistent.
I really want to see this project to completion so any ideas you may have on how to do this would be very appreciated.
Thanks,
Brett
var jstpl_player_card = '<div class="playercard charactercard" id="cardspotx_${cardSpot}" style="background-position:${x}px ${y}px"></div>';
</script>
playCardsFromHand: function(player_id, card_graphic_x, card_graphic_y, empire, position, player_color_letter, counter)
{
console.log("PlayCard");
dojo.place(this.format_block('jstpl_player_card', {
cardSpot : counter,
x : this.redcardwidth* card_graphic_x,
y : this.redcardheight * card_graphic_y}),
'playertable_' + empire + '_' + position + '_' + player_color_letter);
this.placeOnObject('cardspotx_' + counter, 'overall_player_board_' + player_id);
this.slideToObject('cardspotx_' + counter, 'playertable_' + empire + '_' + position + '_' + player_color_letter).play();
},
<div class="playercard charactercard" id="cardspotx_1" style="background-position: 450px 210px; top: -52.5px; left: 72.5px;"></div>
At top:-52.5px; left: 72.5px;. It will put the cards there for all 30 spots on the gameboard. As soon as I try to play a card that 'kills' another card. Meaning I need to clear out the old card and play another card in it's spot, now it puts the cards right where they are supposed to go without adding that extra offsetting style. So I can't compensate for the weird positioning because when I call the same routine later in the game it stops doing it.
<div class="playercard charactercard" id="cardspotx_1" style="background-position: 450px 210px;"></div>
Nowhere in my code have I told the cards to have the strange positioning. In fact specifying the top and left positions in the playercard or charactercard class or specifying them in the Javascript template are all ignored and it just puts it where it wants. I need a way to control this so my positioning is always consistent.
I really want to see this project to completion so any ideas you may have on how to do this would be very appreciated.
Thanks,
Brett
var jstpl_player_card = '<div class="playercard charactercard" id="cardspotx_${cardSpot}" style="background-position:${x}px ${y}px"></div>';
</script>
playCardsFromHand: function(player_id, card_graphic_x, card_graphic_y, empire, position, player_color_letter, counter)
{
console.log("PlayCard");
dojo.place(this.format_block('jstpl_player_card', {
cardSpot : counter,
x : this.redcardwidth* card_graphic_x,
y : this.redcardheight * card_graphic_y}),
'playertable_' + empire + '_' + position + '_' + player_color_letter);
this.placeOnObject('cardspotx_' + counter, 'overall_player_board_' + player_id);
this.slideToObject('cardspotx_' + counter, 'playertable_' + empire + '_' + position + '_' + player_color_letter).play();
},