About Store Forum Documentation Contact



Post Reply 
Simulator issues
Author Message
Henrik Offline
Member

Post: #1
Simulator issues
Currently developing an iPad game with my friend and co-worker Salival (Licensed Developer). We ran into an issue when running it on the iPad simulator.

Basically when you turn the iPad to landscape mode it seems to be zooming out the entire game except some of the text. I've attached several pictures below to help explain our issue.

Do you have any clue to why this occures? We're clueless here. It runs just fine in our Windows/OS X environment. What are we missing?

Regards,
Henrik & Salival


Attached File(s) Image(s)
           
(This post was last modified: 10-31-2011 04:58 PM by Henrik.)
10-31-2011 04:56 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Simulator issues
D.scale
D.aspectDisplay
D.aspectMode
D.screen_changed

basically just readjust the D.scale on D.screen_changed call
10-31-2011 06:31 PM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #3
RE: Simulator issues
We have tried to play with these features without any result.

We tried to scale:

D.scale( D.scale() * 1.5f );

We tried to change the D.aspectMode( ASPECT_Y );

But no differences, What could it be?

The picture is when we changed the scale of * 1.5, Now you can not see the text to the right, but everything else is the same.
(This post was last modified: 10-31-2011 08:13 PM by Salival.)
10-31-2011 08:12 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Simulator issues
what is your full code for D.scale?

you need to set it differently in D.screen_changed depending on device rotation
10-31-2011 10:50 PM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #5
RE: Simulator issues
First set the new func, Have tested a lot, but looks like it's only text to the right that resize, all the other 2D rendered stuff stays the same size.

Code:
void ScreenChanged( Flt old_width, Flt old_height )
{
    // Tested all sort of scales.
    D.scale(800 / (Flt)D.y());
}

InitPre - D.screen_changed = ScreenChanged;

We want to lock the IPad to work in landscape mode only (option in xcode) so we do not need a dynamic change in the scale, only a fixed scale, so then we can just call D.scale() in InitPre like normaly, but we can not make it look good on the iPad, works great on any Windows or Mac.

Any ideas?
(This post was last modified: 11-01-2011 08:31 AM by Salival.)
11-01-2011 08:28 AM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #6
RE: Simulator issues
I can give you the full source if you like to try it out yourself. Should be nice to solve the issue.
(This post was last modified: 11-01-2011 12:49 PM by Salival.)
11-01-2011 12:47 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Simulator issues
screen res on ipad is 1024x768
does D.x() and D.y() return 1024, 768 on your simulator?

locking to landscape is:

Double click on "*-Info.plist" file inside your project folder to edit:
UISupportedInterfaceOrientations = (you can remove any of these if you wish) UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight

keep only:
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight

also set in InitPre:
App.valid_orientations=DIRF_LEFT|DIRF_RIGHT;

with only landscape mode, set D.scale only once in InitPre

how are you drawing the 2d images? (with what Rect sizes / scales)

if Text changes its scale then D.scale works correctly, possibly you're using wrong calculation for size of drawing of 2d tiles.
11-01-2011 01:31 PM
Find all posts by this user Quote this message in a reply
Henrik Offline
Member

Post: #8
RE: Simulator issues
This goes without saying, thanks for all your swift responses as per usual. We've got it working now and it renders properly on the iPad, but there's one remaining issue.

When we run the app in the simulator the first time it boots up it's rotated improperly. Though if you rotate it once and then back again to landscape mode, it will show just fine. We're once again clueless to why this is happening. We've tried every single setting to lock it to landscape mode with no avail.

Take a look at attached pictures below to get a better understanding of what I'm trying to explain.


Attached File(s) Image(s)
       
11-01-2011 04:58 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #9
RE: Simulator issues
please wait for next SDK
if in next SDK the issue will not be solved please check carefully correctness of *.plist settings
11-01-2011 09:43 PM
Find all posts by this user Quote this message in a reply
Salival Offline
Member

Post: #10
RE: Simulator issues
Alright :]
11-01-2011 10:37 PM
Find all posts by this user Quote this message in a reply
Post Reply