Universal Builds & DBA's Quick Resize Tool

Hey everyone,

So I'm currently working on converting a project that was originally a Legacy iPhone project to an iPad project so I can apply universal builds support. I used DBA's Quick Resize tool (not the Project Resizer tool) to convert the Legacy iPhone Portrait Project to an iPad Portrait project, and everything worked according to plan there. To problem came when I implemented GSHelper's sample code into the project to allow for Universal Builds. I've pasted the code I used below for reference.

--------------------------------------------------------

iPhone 4S & Below

Rule: If game.Screen.Size.Height = 480

Change scene.Camera.Size.Width = 862
Change scene.Camera.Origin.X = -46

End Rule

iPhone 5

Rule: If game.Screen.Size.Height = 568

Change scene.Camera.Size.Width = 1024
Change scene.Camera.Origin.X = -128

End Rule

iPad

Rule: If game.Screen.Size.Height = 1024

Change scene.Camera.Size.Width = 768
Change scene.Camera.Origin.X = 0

End Rule

--------------------------------------------------------

Still with me? When I tested this for both Legacy iPhone and iPhone 5 in the Preview Player within Creator, all the actors on my scene had been adjusted vertically, but hadn't been adjusted horizontally, and instead were squished and only placed on the left side of the scene with nothing on the right side. Has anyone encountered this issue before and come up with a solution? I'm sure the problem lies with the fact that I used the method implemented by the Quick Resize tool, but I unfortunately don't have another way of converting my Legacy iPhone project to iPad without it.

Any ideas would be much appreciated! Thanks.

- Alex

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I believe you will have to play with settings and adjust x and y values for each and every platform you plan to support.

    Also imo you should just work out the settings to display the project as iPhone legacy being the base project. No need to distort the game more than once.
  • osucowboy18osucowboy18 Member Posts: 1,307
    Good point @tenrdrmer. Of course it would be best if this project had been originally developed for iPad, but I do have iPad retina artwork made, so hopefully scaling up from iPhone to iPad with high resolution art won't distort the quality too badly. Thanks for the tip.

    - Alex
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    edited April 2013
    Or you could build in iPad and depending on the game.Screen.Size width and height, you can figure out how much is cropped off.

    e.g. if you build in Landscape iPad (1024x768), iPhone(568x320) will translate to (1024x320*1024/568) and you will be cropping off (768-(320*1024/568))/2 from the top and the bottom. So you adjust logic or use tables to adjust the position of your actors to assume the bottom of your viewing area is approximately 95.5 and the top is approximately 672.5.

    Generically you just use the game.Screen.Size.Width and game.Screen.Size.Height in the calculations actors in the iPad Landscape should readjust to fit within
    (1024 x game.Screen.Size.Height*1024/game.Screen.Size.Width)

    where the bottom border would be at:
    (768-(game.Screen.Size.Height*1024/game.Screen.Size.Width))/2 =
    384-(512*game.Screen.Size.Height/game.Screen.Size.Width)

    and the top border would be at:
    (768-(game.Screen.Size.Height*1024/game.Screen.Size.Width))/2+(game.Screen.Size.Height*1024/game.Screen.Size.Width)=
    384+(512*game.Screen.Size.Height/game.Screen.Size.Width)

    You'll have less area for game play, but actors won't be squished.
  • osucowboy18osucowboy18 Member Posts: 1,307
    @CodeMonkey, thanks so much for your help on this. Would these calculations ( for top and bottom) need to go in every actor, modifying each actor's position.x and position.y, or am I missing something?

    I understand the math equations and formulas you've provided above, but am just unsure where and how they would be used to get the desired effect. Thanks again!

    - Alex
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    depends on your art and layout. UI HUDs would use them so they won't be cut off the screen. Some actors could use it to determine how far you can scroll upwards to show what would be cut off, and in this case even the background and other things would need to shift up.
    Depends on the game type too. Some games may favor this method over the other.
  • osucowboy18osucowboy18 Member Posts: 1,307
    Ok, I'll play around with it and see what I can come up with. How much tweaking do you anticipate for a portrait project? I know the formulas you provided above were for landscape apps, but how would the be rewritten for a legacy iPhone project in portrait mode? Thanks again for your help @CodeMonkey.

    - Alex
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    If you don't want your actors to look stretched or squished and you would rather just have a cropped off view, then start/resize with the larger dimensions. Then use ratio aspects to determine how much will be cropped off.

    H1/W1=?/W2 -> ? = H1*W2/W1
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I personally hate cropping off my games. I made it to have a certain scene viewable and I want it to all be there on every device. I can deal with the squished or streched actors as long as its all there. I really hope GameSalad finishes the UB feature so we have all the options it should.
  • osucowboy18osucowboy18 Member Posts: 1,307
    Thanks again for the help guys. Although, I would have to agree with @tenrdrmer on this one - I'm looking forward to a full-fledged Universal Binary feature so we don't have to go through this process for every project.

    - Alex
Sign In or Register to comment.