Hi - this seems like it should be a common question but I can't find many references to it from googling.
If you export a game using the HTML5 module, it will come up crisp in PC browsers but be blurry and pixellated on mobile devices. I've tried changing the size of the html canvas, and I have tried display_set_gui_size(display_get_width(), display_get_height()); but nothing seems to affect it.
I have my game set to scale to fill the device window, but I can't see that that makes any difference, because I have also tried putting the game in an iframe (ie. shrinking it) and that doesn't increase the sharpness.
I have also tried adding this into the html:
But this makes no difference either.
If you export a game using the HTML5 module, it will come up crisp in PC browsers but be blurry and pixellated on mobile devices. I've tried changing the size of the html canvas, and I have tried display_set_gui_size(display_get_width(), display_get_height()); but nothing seems to affect it.
I have my game set to scale to fill the device window, but I can't see that that makes any difference, because I have also tried putting the game in an iframe (ie. shrinking it) and that doesn't increase the sharpness.
I have also tried adding this into the html:
Code:
<script type="text/javascript">
var canvas = document.getElementById("canvas");
function canvas_resize(){
canvas.width = 1920 * window.devicePixelRatio;
canvas.height = 1080 * window.devicePixelRatio;
}
window.addEventListener("orientationchange", canvas_resize);
document.addEventListener("DOMContentLoaded", function () {
canvas_resize();
})
</script>