sprites works on chrome. firefox loads wrong image

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

sprites works on chrome. firefox loads wrong image

Post by developgame »

Hi:
This is my tpl

my images work perfectly on chrome, but firefox loads the wrong sprite image. When I check element inspect in firefox, everything seems to be fine.

Thanks a bunch for any help!!!!

This is my .tpl
<div id="map_container">
<div id="map_scrollable"><div id="chamber" ></div></div>
<div id="map_surface"></div>
<div id="map_scrollable_oversurface"></div>
<a id="movetop" href="#"></a>
<a id="moveleft" href="#"></a>
<a id="moveright" href="#"></a>
<a id="movedown" href="#"></a>
</div>

var jstpl_chamber = '<div id="${id}" class="chamber chamber_${type} rotation_${rotation}" ></div>'


my .css


.chamber {
background-image: url(img/chambers.png);
background-repeat: no-repeat;
display: block;
}

.chamber_basic1 {
width: 120px;
height: 120px;
background-position: 0 0;
}

.chamber_basic2 {
width: 120px;
height: 120px;
background-position: -120px 0;
}

.chamber_basic3 {
width: 120px;
height: 120px;
background-position: -240px 0;
}

.chamber_basic4 {
width: 120px;
height: 120px;
background-position: 0 -120px;
}

.chamber_basic5 {
width: 120px;
height: 120px;
background-position: -120px -120px;
}

.chamber_basic6 {
width: 120px;
height: 120px;
background-position: -240px -120px;
}

.chamber_basic7 {
width: 120px;
height: 120px;
background-position: 0 -240px;
}

.chamber_exit_chamber {
width: 120px;
height: 120px;
background-position: -120px -240px;
}

.chamber_gem1 {
width: 120px;
height: 120px;
background-position: -240px -240px;
}

.chamber_gem2 {
width: 120px;
height: 120px;
background-position: -360px 0;
}

.chamber_main_chamber {
width: 120px;
height: 120px;
background-position: -360px -120px;
}
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: sprites works on chrome. firefox loads wrong image

Post by Victoria_La »

Define "wrong sprite image"?
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

Re: sprites works on chrome. firefox loads wrong image

Post by developgame »

Thanks for your reply, Victoria La,


On my /img directory, i am using chambers.png, so It is not because Firefox is expecting png .


Thanks again!!!
Attachments
This is firefox . The images are wrong, rotation correct
This is firefox . The images are wrong, rotation correct
firefox.jpg (8.46 KiB) Viewed 784 times
This is chrome. Image is correct, rotation correct
This is chrome. Image is correct, rotation correct
chrome.jpg (9.51 KiB) Viewed 784 times
This is the main sprite image
This is the main sprite image
chambers.jpg (36.63 KiB) Viewed 784 times
Last edited by developgame on 24 October 2020, 21:23, edited 1 time in total.
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

Re: sprites works on chrome. firefox loads wrong image

Post by developgame »

It now all works properly. not sure why. I will keep an eye on it

Thanks again!!!!
User avatar
paramesis
Posts: 398
Joined: 28 April 2020, 05:00

Re: sprites works on chrome. firefox loads wrong image

Post by paramesis »

Did you change the image at some point? What you described earlier sounds like your browser had cached a previous version of the file.
Whenever you make changes to images or CSS, you should do a hard refresh (CTRL+F5).
Post Reply

Return to “Developers”