New Universal Build Method: iPhone 4 & iPhone 5

VoidedSkyVoidedSky Member Posts: 1,095
edited February 2013 in Working with GS (Mac)
Hey all!

I was working on my game, and checking out the new Universal Binary stuff. I saw Darren's method of adjusting the camera, and I messed around with that, but I didn't like how the images stretch. So, I came up with my own method. All you do is drag the code into each actor in the scene, and it re-adjusts the size and position of the actors based on the screen size. What I have in my demo, is as follows: The scene is made for iPhone 5, and it re-adjusts for the iPhone 4. You can mess around a little with the code to make it do the opposite, and you can probably make a version to convert games to iPad resolution. But right now, all it is, is for iPhone 4 and iPhone 5.


iPhone 5

image


iPhone 4

image


What the code does, is finds where the actor is relative to the screen, and recreates its position in the new screen size. So basically, it is using its percent of the location on the screen. The code also resizes the actor, so it is the same relative to the other actors in the scene. For example: You have a platformer game, and you have two blocks right next to each other, not overlapping, and with no space in between them. If you just resized the scene from iPhone 5 to iPhone 4, the actors would then overlap. Respectively, if you made the scene for iPhone 4 and converted it to iPhone 5, there would be a gap between the two actors. The resizing of the actors fixes this problem. The actors are smaller, but they are in the correct spot relative to each other.

You can get more info on my site Here

You can also download it below

I hope this at least helps some people!

~Josh
«13

Comments

Sign In or Register to comment.