I have created a app using SprikeKit and SKScene, the app runs perfectly on all iPhone simulators however with the iPad simulator, the top is cropped. Is there any settings to have this as an auto layout?
See image attached for GameScene.sks settings
Screenshot
No, SpriteKit does not behave the same as UIKit. It is designed for game development, so an "auto layout" feature is something that would be considered a very low priority to implement since not many games would utilize it outside of an overlay. If you want to make your game appear the same vertically on all devices, then make your scene size a 3:4 aspect ratio. This would mean that cropping will happen on the sides of iPhones.
You could fill in the extra space on the sides with eye candy like bushes so your iPad and iPhone will play the same, but iPad users would just see more.
Related
I'm using sprite kit; my scene won't fit on the iPad, it's like cut off, I've tried everything I know but still can't get it to work. It works fine on all the iPhones but has a problem when it comes to the iPad
The hard work would be to make one .sks file per iPhone/iPad size.
The logic part would to consider what users ""really see" in all devices: 3 to 8
we need to stay at first level imaging : myImage#1x.png
iPhone and iPad scale up and down to fit best to each other
take the smallest screen size and scale it up to fit to bigger devices.
and you will see that there is a rectangle that is always seen in all devices at any scale
all the parts that are off this rectangle, would be the plus parts but non essential to the main part.
this link helps you to do this : https://v-play.net/doc/vplay-different-screen-sizes/
Why do original iPhone applications (normal screen size like iPhone 4/4s) in Xcode resize perfectly for iPad automatically and not for the slightly larger iPhone 5 screen size?
To fit a iPhone 4 view into the iPad each point is scaled equally into two directions. The aspect ratio of a iPhone4-point doesn't change on the iPad screen.
To fit a iPhone 4 view onto the iPhone 5 screen, each point has to be scaled in vertical direction only. This will distort each point and the view, similar to the distortions you get when you watch a movie in the wrong aspect ratio. A circle on the iPhone 4 screen won't be a circle on the iPhone 5. So you can't physically resize the pixels like it's done on the iPad.
In iOS-Development Autoresizing Masks come to the rescue. But there is no way to figure out if your app looks good if the auto resizing scales the view to iPhone 5 size. You have to test each app on a iPhone 5 sized screen. Apple didn't want to do this, so they put an opt-in in place, which you actively had to enable. They choose to use the iPhone5 launch image for that.
If your app looks good when it's vertically scaled simply provide the appropriate launch image.
If you used best practices to develop your iPhone 4 app that's basically all that is needed.
iPhone 5 support needs to be explicitly added by supplying a "Default-568h" start image.
i want to make my game universal. but when i try it on ipad, my background layer only covers 1/4 of the screen, but the sprites can go the entire screen. also the sizes of sprites are too small, didn't scale up.
when i see the apple doc, it says i have to "if else" to detect device every time use coordinate. but there are just so much code to be modified.
so is there any way to solve this? like just change in one place?
When you make your game universal, You have to rename your resources to support the ipad size.. meaning : sprite-ipad.png
It is not suppose to scale up when you choose universal app.. You can to redo the sprites..
As cocos2d auto handles the coordinates of the sprites when it is on different devices, it should be all over the device..
If you do not wish to redo the images, you can just choose to build for iphone.. It would be able to scale up when the player downloads it on the ipad..
I've written an application for the iPad that I'd now like to get working on the iPhone (a universal application).
At the moment it runs in the iPhone simulator, but the UIKit elements are positioned using pixel positions - so a lot of them are offscreen. Additionally my UIImages are too big, and need to be scaled to fit the iPhone. How do I go about doing this?
Thanks in advance.
Some more information:
If I position a UIImageView using UIBuilder, the image displayed takes up the same ratio of the screen if displayed on the iPad or iPhone. Which is what I want, however I need to do it programatically.
If I create a UIImageView programmatically it will take up a much larger ratio of the screen on the iPhone compared to the iPad.
Edit:
My nib is actually empty apart from a OpenGL view. The OpenGL view is scaling fine.
I do create a few UIKit controls programmatically and this is where the problem is happening.
Probably the easiest way: make two separate xibs (1 for iPad, 1 for iPhone).
Start a new universal project and migrate the curent one into it, it'll take some time, but it'll save you a lot of headaches.
I know there are multiple questions about this but I wish for this one to help my specifically with my application. Here is an overview on my application:
I have a scrollview that holds a 7-page brochure. On one of the pages, there is an animation (a simple, cycling series of images). The images are currently 500x750 but the scrollview condenses them to the iPhone dimensions (to allow for zooming).
What I would like to know, is how you would see this on an iPad. I know iPads can run iPhone apps (but they are pinned to the upper corner). What considerations would I have to take into account to allow this to be displayed very well on an iPad?
For you app to display well you'll need to port it to the ipad.
You'll need to do versions of your views for the ipad screen size, or make sure that your existing views expand properly and look good on the ipad screen. I'd imagine you'd want to display your 500x750 images at their native size, and possibly add some ui furniture to fill up some of the rest of the screen space.
This question has reasonable answers for explaining how to do the port:
How to port existing iPhone application to iPad
If you don't port your app to the ipad, it will run exactly how it will on the iphone, either in a small box in the centre of the screen or magnified 2 times.