Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

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(&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?

1 decade ago by dominic

Please try the latest version from github. The orientation problem should be fixed.

I'll package this up into a new "release version" in the coming days and write a detailed changelog.

Edit: the canvas should still have covered the whole screen. Note that with the snipped you posted, you actually change the internal width of your game. Ejecta never stretches the canvas unevenly in width and height. You always end up with square pixels.

Your internal 862px height will be scaled up to 1024px (1.189x scale), the internal width of your game will be changed from 738px to 646px and equally scaled up (1.189x scale) to 768px.

1 decade ago by dmarchand

Great, thanks! The latest version seems to have resolved the orientation issue

1 decade ago by dmarchand

Oh, and thanks a ton for the awesome update.

Did you include some performance improvements as well? I used to have issues with ig.system.strokeRect, but it appears to no longer cause framerate issues.
Page 1 of 1
« first « previous next › last »