iphone 4 how?

Get help using Construct 2

Post » Sat Aug 25, 2012 11:21 pm

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!
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Sun Aug 26, 2012 2:28 am

I think if you use appmobi, you can get rid of the bar. That's all I know.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Aug 26, 2012 2:16 pm

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?nutmix2012-08-26 14:18:34
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Mon Aug 27, 2012 10:27 am

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:

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

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.

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

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.
B
15
S
5
G
2
Posts: 357
Reputation: 3,691


Return to How do I....?

Who is online

Users browsing this forum: Colludium and 29 guests