1 decade ago by dmarchand
I've been playing with Impact + Ejecta on IOS5 + 6 (ipad 2 right now), and have been trying to get my game's canvas to fit properly.
So far, I've run into two issues:
My game runs natively at 738x862. Obviously this isn't ideal for the ipad, but I can't get it to scale properly at all.
I've tried two approaches, with varying degrees of success.
My first approach was just to render at the native resolution and see how it fits. It worked surprisingly "OK", and the game fit decently on the screen. However, it only worked for every orientation EXCEPT "Portrait (Home Button Bottom)". For some reason the game would never rotate into that position properly. It was stay in a landscape resolution. Curiously, when in portrait with the home button on top, it worked perfectly! Any ideas why?
While trying to resolve this, I used the approach outlined in the guide to render the canvas:
#var height = 862;
var scale = window.innerHeight / height;
var width = window.innerWidth / scale;
ig.main(&
This didn't fix the orientation problem, and regardless of the selected scaling type, the canvas would never actually fit in the screen.
Does anyone have any experience with working through these types of issues?
So far, I've run into two issues:
My game runs natively at 738x862. Obviously this isn't ideal for the ipad, but I can't get it to scale properly at all.
I've tried two approaches, with varying degrees of success.
My first approach was just to render at the native resolution and see how it fits. It worked surprisingly "OK", and the game fit decently on the screen. However, it only worked for every orientation EXCEPT "Portrait (Home Button Bottom)". For some reason the game would never rotate into that position properly. It was stay in a landscape resolution. Curiously, when in portrait with the home button on top, it worked perfectly! Any ideas why?
While trying to resolve this, I used the approach outlined in the guide to render the canvas:
#var height = 862;
var scale = window.innerHeight / height;
var width = window.innerWidth / scale;
ig.main(&
039;#canvas', MyGame, 60, width, height, 1);
This didn't fix the orientation problem, and regardless of the selected scaling type, the canvas would never actually fit in the screen.
Does anyone have any experience with working through these types of issues?