Help - Adjust screen size for iphone 5 & 6 with diff backgrounds
sysads
Member Posts: 146
Hi, I have seen lots of posts on how to adjust your ipad project to fit iphone 5 & 6 but all are a little confusing. I have tried some but not able to get it to work. As a newbie, is there a way I can simply change background from ipad to iphone 5 or 6, and maintain current position of my actors.
My intention is to avoid using overscan but only maintain letterbox
Comments
anyone able to help or share ideas?
Personally I build an ipad project but preview it in iphone 5, overscan and work around that.
I've seen projects that manipulate the camera and then stretch the game so its the same size for all devices. If you want that, search the forums using the key words 'universal build'
I dont like that build personally because on iphone 5/6 everything looks tiny.
I've done this in the past, You will want to change camera size width and then offset camera origin that way everything stays centered and you will just add a bigger background to cover black area, and use stretch.
So what you will do is detect display size do some math get new camera size adjust scene camera size then more math get camera offset then change scene camera origin to a negative offset and all works,lol
This works well for non-scrolling game scenes because everything really need to be on moveable layers otherwise origins of images stay at left corner (You can play around and see what happens when deselecting movable).
So I made a quick test you can play with and see how it works.
So the only thing thats changing is scene.camera origin.X to negative game.offSet. So what you end up with is LetterBox but you can add a image to the Black area that would normally be there.
So with example below just change to new device size and select stretch and reset and you will see whats happening.This should work on any device.