Use Image in .TPL File

Game development with Board Game Arena Studio
Post Reply
changohango
Posts: 1
Joined: 23 April 2024, 17:52

Use Image in .TPL File

Post by changohango »

Hello! New BGA Developer here.

I am trying to insert an SVG into my file, and I have uploaded the SVG in the /img folder. I have verified that the file is there by using an SFTP client. However, whenever I try and use the image in the .tpl file, its not showing up in the game.

This is how I'm trying to load it in:

Code: Select all

<img src="/img/board_components/filename.svg">
I have tried variations of the path, such as beginning with "./", without the initial forward slash, I've tried backslashes, and I just can't figure it out.

I even tried loading in an external image just cause I was curious if the <img> element works in .tpl files. Loading an external image worked (using image URL), but anything on the server won't load.

Am I missing something here?
User avatar
RicardoRix
Posts: 2135
Joined: 29 April 2012, 23:43

Re: Use Image in .TPL File

Post by RicardoRix »

You might need to do something like this

Code: Select all

src="{GAMETHEMEURL}img/image.png"
or maybe it's

Code: Select all

src='" + g_themeurl + "img/image.png'
And I'm not sure if you can use sub directories.
Post Reply

Return to “Developers”