placeOnObject and have no image

Game development with Board Game Arena Studio
Post Reply
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

placeOnObject and have no image

Post by developgame »

Hello All:
Thank you for any help with this
Can you please help me?
I cannot see why I do not get the card image on my "cardontable" element when I use placeOnObject -
This is my tpl

Code: Select all

<div id="playertable" class="playertable whiteblock" >
	<div id="cardontable"></div>
</div>
<script type="text/javascript">
var jstpl_cardontable = '<div class="cardontable" id="cardontable_${player_id}" style="background-position:-${x}px -${y}px">\
                        </div>';
</script>
this is my javascript

Code: Select all

 for (var i in this.gamedatas.cardsontable )
	{
		var card = gamedatas.cardsontable[i];
                var color = card.type;
                var value = card.type_arg;
		var card_id = this.getCardUniqueID( card.type, card.type_arg );	
		dojo.place(
			this.format_block( 'jstpl_cardontable', {
				x: this.cardwidth*(value-2),
				y: this.cardheight*(color-1),
				player_id: card_id                
			} ), 'cardontable' );
		this.placeOnObject( 'cardontable_' +card_id, 'cardontable' );
	}	
As shown on the attachment, an inspect shows the new cardontable_card_id element

Thanks again
Attachments
ex.jpg
ex.jpg (34.36 KiB) Viewed 441 times
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: placeOnObject and have no image

Post by Tisaac »

What does your css looks like ?
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

Re: placeOnObject and have no image

Post by developgame »

Thanks a bunch for your help, Tisaac!!!!!!
Good question,
Problem fixed. I forgot to add the cardontable class

:D
Post Reply

Return to “Developers”