iphone 4 how?

0 favourites
  • 4 posts
  • I am trying to get an app working on iphone4, by setting the window size to 640x960, then using crop mode to allow the variuos IOS tool bars to cover the top and bottom of the page.

    However, what comes out is only small amount of the center of the game blown up large.

    printing the WindowWidth and WindowHeight, its coming out at 356x320, which is iphone 3 resolution (yes I am sure I have an iphone 4).

    I could create a game and assets at iphone 3 resolution, but then they will look much worse than they should on the iphone 4.

    Anyone got any idea how go get iphone4 working at its native resolution?

    Also, I cant get the address bar to go away. I have seen hundreds of posts saying this always works:

    window.addEventListener("load",function() {

    // Set a timeout...

    setTimeout(function(){

        // Hide the address bar!

        window.scrollTo(0, 1);

    }, 1000);

    });

    Or this:

    addEventListener("load", function() {

        window.scrollTo(1, 0);

    }, false);

    However, adding this to the result of any construct 2 exports (USING CROP) index.html file doesnt get rid of address bar.

    NOTE: both solutions require the page to be longer than the visible area, which mine is, or is it? I tried adding some extra <br>s at the end nd it works! I get rid of the address bar. However, now I ahve a big black gap at the bottom from by <BR>s. Construct 2 devs, please fix this!

    This is a huge problem - all the competitions games get rid of the bar, and the customer wornt accept us not getting rid of the bar to allow additional game space.

    Has anyone manged to figure out how to do this with the particlar pages that construct 2 creates in crop mode? Perhaps its the centering which is the problem?

    Thanks!

  • I think if you use appmobi, you can get rid of the bar. That's all I know.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Looks like im on my own for iphone 4 development.

    I found a solution to the resolution issue - just switch "Use iOS retina display" to on. Now I need to check what that does to non retina displays, then Im sorted for resolution.

    For the address bar issue, its doable, its just a pain to have to hack the HTML.

    Im shocked that onone has come up against this. I.e. it seems noone is using construct 2 for browser based mobile, which some might say is the most important area of development right now.

    Why would anyone want to produce an appstore packaged game and pay apple 30%, and not beable to offer gambling games etc, when they can just do it in a web page and achive near native games?

  • I am still trying to find a good way of getting rid of the address bar. For a constrct 2 developer who knows HTML5, Im hoping this will be very easy.

    The partial solution is simply to put this:

    addEventListener("load", function() {
        window.scrollTo(1, 0);
    }, false);
    

    into index.html, then to make the page longer than the area which is under the address bar. E.g. I can do this by adding three or more <br> at the beginning or the end of the page, e.g.

    <body> 
        <br><br><br>
        <div id="fb-root"></div>
    

    but this puts a big black bar at the top or bottom of the page instead of the address bar, so is a lose.

    What we need is a way to force the output page to be the right size, instead of the cropped dimentions which include the address bar.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)