• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Drawing wrong sprite in html5

Lioran

Member
I'm having trouble when the target is set to html5. draw_sprite will draw the wrong sprite.
Is that a known issue of some sort?
Only fix I've found so far is to force every sprite in 3d texture.
As soon as it's put in the collective texture page it draws the wrong sprite,
or at least as high chance to.
Does anyone know some other fix?
 

chance

predictably random
Forum Staff
Moderator
Sometimes when working in HTML5, the texture page pointers get corrupted. So the wrong sprite gets drawn.

Try "clearing the cache" before running your game. (The broom icon on the tool bar.) That usually fixes these issues.
 

Karlstens

Member
Erk, I've just hit this bug too, all my HTML5 sprites are wrong and the game crashes. Any further tips for fixing this? My build worked just fine a couple of days ago...
 

TibiSoft

Member
Any solution here? (Cache cleaned, GMS restarted). Windows.exe & Android apk runs well, html5 shows other sprites then expected (like shifted memory). I test it locally. Thanks.
 

rIKmAN

Member
Rather than just clicking the broom, try clearing all the caches manually from File > Preferences > General > Paths.
There's 3 in there and you can click each button to clear them.

Also, if you export your game and run it on a server are the sprites still messed up or is only when run from the IDE?
 

TibiSoft

Member
Thank you, meanwhile I have found that solution and that helped.
Or - maybe I used the broom in a wrong way in the past - I have to push "Stop" at first (even if nothing is running) and after that push the broom for cleanling. It also helps me.
 

ttuuvee

Member
Rather than just clicking the broom, try clearing all the caches manually from File > Preferences > General > Paths.
There's 3 in there and you can click each button to clear them.

Also, if you export your game and run it on a server are the sprites still messed up or is only when run from the IDE?
Uuf 2022 and this is still a thing. Clean did nothing. Had to use your method.
 

rIKmAN

Member
Stopping your program from running before cleaning the cache will always be a thing, that’s how you’re meant to do it.
 

JohnNWFS

Member
@rIKmAN, thanks. Your advice solved my issue as well. Specifically had to clear the cache at File > Preferences > General > Paths as recommended and (for me) the problem browser version of the exported build was working. It's possible the clean tool would have worked fine as well, I cannot recall if I left the HTML5 server running when I last built the project, before using the cache cleaning step. In any case, kudos for the help!
 
Rather than just clicking the broom, try clearing all the caches manually from File > Preferences > General > Paths.
There's 3 in there and you can click each button to clear them.

Also, if you export your game and run it on a server are the sprites still messed up or is only when run from the IDE?
Sorry to bump again but this time it's only a month! This worked for me too. Also having the cache set to a network drive probably didn't help either (I didn't realise it was until I went in there to clear it).
 
Top