9 years ago by phi
When using Ejecta the scale function is causing long loading times and some strange loading effects on a real iDevice. The first solution was not to use scale but the screen canvas .style property to stretch the canvas over the whole screen.
The loading times are fast again but this introduces very choppy movement even tough the game runs at a stable 60fps. I tried the methods from this old thread but it does not seem to fix the problem.
camera movement in the player.js
main.js using canvas.style => results in choppy movement but is loading quickly
main.js using stretch => results in smooth movement but is loading very slowly
The loading times are fast again but this introduces very choppy movement even tough the game runs at a stable 60fps. I tried the methods from this old thread but it does not seem to fix the problem.
camera movement in the player.js
this.parent(); //parent before camera movement as suggested in the old thread ig.game.screen.x = this.pos.x.round() - ig.system.width / 2; ig.game.screen.y = this.pos.y.round() - ig.system.height / 2;
main.js using canvas.style => results in choppy movement but is loading quickly
var width = 256; var height = 192; var canvas = ig.$('#canvas'); canvas.style.width = width*3 + 'px'; canvas.style.height = height*3 + 'px'; ig.System.scaleMode = ig.System.SCALE.CRISP; ig.main('#canvas', MyGame, 60, width, height, 1);
main.js using stretch => results in smooth movement but is loading very slowly
var width = 256; var height = 192; ig.System.scaleMode = ig.System.SCALE.CRISP; ig.main('#canvas', MyGame, 60, width, height, 3);