Universal Builds & DBA's Quick Resize Tool
osucowboy18
Member Posts: 1,307
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
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
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.
- Alex
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.
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
Depends on the game type too. Some games may favor this method over the other.
- Alex
H1/W1=?/W2 -> ? = H1*W2/W1
- Alex