• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

HTML5 image_index in HTML5

D

Darknova36

Guest
Good day.
I've got a problem with the variable "image_index" in HTML5 and I don't know if it's my or GMs fault.

The problem is that in Windows VM and YYC, you can set image_index to decimal values like 1.5, 1.82, 2.3 etc. and in HTML5 you can't.

If I do "image_index = 1.6" in HTML5, the image_index that's actually being set is "image_index = 1". In Windows it gets set to "image_index = 1.6" properly. It seems to floor it in HTML5 for some reason.

I'm guessing it's a bug. Is there any way to get around it and set image_index to decimal values in HTML5 because I really need it to work?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
I'm guessing it's a bug. Is there any way to get around it and set image_index to decimal values in HTML5 because I really need it to work?
Sounds like a bug indeed, and if you could file it with YYG that would be great (include a link to download a test project that shows the issue too, please!). You can do that from the Help menu in GMS. As for working around the issue, use a custom variable like i_index or something and then draw the sprites using draw_sprite() or draw_sprite_ext() and substitute the image_index argument for the custom variable.
 
D

Darknova36

Guest
Sounds like a bug indeed, and if you could file it with YYG that would be great (include a link to download a test project that shows the issue too, please!). You can do that from the Help menu in GMS. As for working around the issue, use a custom variable like i_index or something and then draw the sprites using draw_sprite() or draw_sprite_ext() and substitute the image_index argument for the custom variable.
Thank you. The i_index workaround works fine and I submitted the bug report
 
Top