How to change to Landscape on iPhone

Previous topic - Next topic

okee

Maybe i'm missing something but is there a command to force the screen
from portrait to landscape mode.
Also is there any way to display a sprite instantly, the minute the app is loaded,
currently the screeen is black for about 4 seconds and then the first screen of
the app is displayed, it's only an app with a few lines of code.
tried a showscreen very early in the program but didn't help


thanks
Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

MrTAToad

I presume you are talking about the iPhone ?  Is so, you just need to swap the screen resolutions around to change to landscape mode.

You can get an initialising screen to be used while the program loads - take a screenshot of the game and select the appropriate option for it.  Aside from that, there is no real way.

okee

#2
Yeah, it's set to change the resolution and it works on the pc but not on the iphone.
Actually i'm using setscreen to change, does that work on the iphone?

Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

kaotiklabs

Try it too in the project properties, under iphone platform.
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

MrTAToad

QuoteActually i'm using setscreen to change, does that work on the iphone?
Yes, it does.

matchy

It should take less less than a second to start an app, not including debugging or image loading.

okee

#6
Just to explain clearer, I want the start view to be portrait, the user touches the screen
and the next screen appears in landscape, so the user must rotate the phone to view the
screen properly
Do i have to fake the rotation with joystick controls ?

Edit: Actually i'll try it with the fullscreen parameter

Code (glbasic) Select

// Landscape resolution
GLOBAL Lgfx = 480
GLOBAL Lgfy = 320
// Portrait Resolution
GLOBAL Pgfx = 320
GLOBAL Pgfy = 480
SETSCREEN Pgfx,Pgfy,0
SETCURRENTDIR("Media")

LOADSPRITE "bg1.png",0
LOADSPRITE "bg2.png",1
LOADSPRITE "button.png",2

GLOBAL BackImg = 0
CONSTANT GAMEOVER = 0

// Main Loop
WHILE GAMEOVER <> 1
LOCAL sx,sy
LOCAL mx,my,b1,b2
MOUSESTATE mx,my,b1,b2
IF b1 = 1
SETSCREEN Lgfx,Lgfy,0
BackImg = 1
ENDIF
DRAWSPRITE BackImg,0,0
GETSCREENSIZE sx,sy
PRINT "X: " + sx + " Y: " + sy,10,300
SHOWSCREEN

WEND
Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

Kitty Hello

oh dear. Does that work? I mean... it should, but I'm uncertain.

okee

The code above doesn't seem to, and i changed it to setscreen Lgfx,Lgfy,1
i wasn't using 1 for fullscreen earlier.
After i do       

SETSCREEN Lgfx,Lgfy,1

the print output shows the sx as 320 and sy as 480

   GETSCREENSIZE sx,sy
   PRINT "X: " + sx + " Y: " + sy,10,300


Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

okee

Kitty is this a "feature" or an error on my side ?  :)
Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

Kitty Hello

Very strange. I'll have to see why.