Canvas Element become small on simulator (Unity2d) - ios

I am developing a 2d game. I am on step where i have to make score things and button. I am doing this by canvas. It working fine on unity but when i test that on simulator all things become small and not showing in actual size. Can any one help me in this case.
In Unity
in Simulator

Try to change Canvas settings like below,
And for device like focus, change preview in Game tab from Free Aspect to any defined resolution. Like,
Then set sizes of your UI elements.

Related

Submitting an iOS game, viewport is completely wrong for App Store reviewer but fine on all of our devices

I have a game we're trying to release in the app store for iphone and ipad, and while it works fine on all of our devices (a handful of iphones and ipads), when the app store reviewers try it the actual viewport they see is highly cropped and distorted.
This is an example options screen that the reviewer saw:
This is what that options screen looks like for us on an equivalent aspect ratio/resolution:
As you can see, it's just a small, off-centered square for them, surrounded by black. But we've tested this on devices like an old iphone 5 up to big ipads and have never seen anything like this, the game takes up the full screen and the aspect ratio is correct and not distorted or stretched.
One important detail is this is entirely an OpenGL and SDL program, not using any Apple UI frameworks at all. The render size is determined by SDL_GetRendererOutputSize(), which then is used in glViewport(), and the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag. This so far has seemed to work with both retina and non-retina physical devices.
Also all of the screenshots they've given us look the same, same little square viewport surrounded by black, so I originally thought they were cropping them on purpose to highlight specific components of the screen, but this appears to be just exactly how it looks for them as this square is in the same position in each screenshot. I've asked them for more information on their devices but they wouldn't tell me.
We also have the program set to only ever use landscape, not portrait, but the weird thing is that with the way our UI reflows, the only way to get that button to look squished the way it does there is if the game was somehow still rendering in portrait, as seen this example shot I took by forcing it to run in a very tall portrait window:
I don't even know where to begin to try to figure out what's going wrong for them though, because as I've said, everything looks fine when running in an emulator and everything looks fine when we've run it on several physical devices. Is there some build or release configuration I could be missing? Some OpenGL setting I should check? I'm just hoping this problem looks similar to something someone else has encountered before.
If you are on an equivalent device, then another thing that may differ is the accessibility settings. Search for display zoom in settings. Also, try locking the iPad into portrait mode before launching your app to try and reproduce.
Note the little double arrow icon in the lower right corner of the reviewer’s screenshot. I don’t know what that is, but it looks like it could be some kind of screen zoom or accessibility mode. Perhaps they can answer what it does, and how to enable it for yourself.
To follow up with the solution that worked for me, I noticed that in my project's General settings in Xcode, under Deployment Info, I had only checked iPhone and not iPad. What I've since learned is that without that checkbox, some iPads will have to run in an emulation mode, which may have been the source of our problem. Deploying a new build with that checked (as well as "requires full screen"), it rendered exactly the same on our own iPads, but the app was subsequently approved with no further problems. I had made no other changes to the program, so my assumption is that that setting likely fixed it.

Unity Canvas scale issue on iOS

I've got a weird issue with Unity, where the height of the screen doesn't match the layout built in the editor, but only on iOS. It does work in the editor, in a Windows standalone and in the Android app, but not on iOS (im testing on an iPhone 5).
So the menu layout can be broken down to just a couple of full width images with different y-positions. These images are set to stretch in height, so no matter how I change the play-preview in the editor, they always fill the screen as intended.
As soon as I test it on the iPhone however, it looks like there was height added to the screen after calculating all the image heights or something. Every image seems to be about 10% too short.
This all did work some weeks ago, when I was on an older iOS version, xcode version and Unity version, but I updated them all in the meantime, so I can't say which one could be the cause for this.
Some weeks ago, the minimum iOS version in Unity was set to 7.0, now it has to be at least 8.0 to not get the "update project settings" warning in xcode.
The roughly 10% could be the iOS status bar, which could be taken into account for the height calculations, but then turned off and the game can span over the whole height.
The iOS "Resolution and Presentation" settings are set to require fullscreen and hide status bar.
Edit:
Here's what it looks like in the editor and on iOS.
The 4 different canvas have just different settings for the canvas scaler. The images in all of them have their RectTransform set to stretch in both directions.
It turned out to be caused by the generation of mipmaps.
I don't know why this is the cause and I don't know, why it's only a problem on iOS, but not on any other common platform, but once I used an image that had mipmaps disabled, it worked.
It then also worked on the original images, once I deactivated the mipmaps there.
I guess it has someting to do with the gradient images being 1x1920, so mipmaps make little sense. I'm wondering, why this is making the height buggy and not the width.

Playable area in Spritekit iOS

I am making a landscape universal game with Spritekit and Swift in Xcode 6.1. I have been researching about how to make a universal app, and there seems to be a lot to do in regards to layout so that your game looks the same across all devices.
I have read that you can do this by defining a "playable area" in which you put all your game features into. The link below shows a image explaining the playable area idea.
http://cdn5.raywenderlich.com/wp-content/uploads/2013/09/Aspect-Ratio-Diff.jpg
Apart from the 1 tutorial I have found online talking about this, (which wasn't for Swift) I cannot find anything about how to actually "define" a playable area for Swift in Spritekit.
Is there a way I can create a rectangle, lets say on the iPhone 6 for example, so that it will cover all devices as long as I build my game within that rectangle?
Basically how do I define a "playable area" so that I can see the boundaries that I have to build my app within? Like in the linked picture?
To make the layout appear the same on every device , assuming u support iPhone 5 and above only . You can make use of .Aspectfill under your GameViewController to scale the scene to fit all the resolutions. This means that you will be using the iOS 5 simulator and that you will relinquish support of iPhone 4s.
The best way to define a playable area would be to either create a rectangle node that encompasses a certain area while ensuring that your physics world is showing physics for testing.
If you want to build for each screen size natively, you would have to adjust your content manually as technically , devices such as the iPhone 6 plus for example are designed so you can see more things.

iOS Simulator - Doesn't show 100% of the screen?

So this is my first time ever using the iOS simulator, because I want to learn how to make iOS apps.
So eventually I dragged a few labels etc. into the storyboard just to try (before learning obj-c)
This is what the storyboard looks like:
This is what it looks like in the simulator:
By the way I can't go the left nor right, only up and down.
use auto layout, also you can bring up the preview of the phone screen to see how the storyboard translates to the actual phone or simulator screen. What it looks like on the storyboard does not directly relate to how it will look on the sim or actual device
Use hotkeys:
CMD+1 for scale 100%
CMD+2 for scale 75%
CMD+3 for scale 50%
Or you can set it in simulator main menu - Window->Scale

Scaling UIViewController and children to fit iPad or iPhone screens

I am developing a game for the app store and have been using Sprite Kit. In Sprite Kit to have the game work on both the iPhone and the iPad I set the SKScene's scaleMode=SKSceneScaleModeAspectFill and made the screen proportions so it would fit the iPhone 4&5 screens as well as the iPad and this has worked well. Now I am building the menus for the app, but I am not using Sprite Kit for this. Instead I am using Collection Views, Buttons, images, etc. I am not seeing a similar property to scale the view to a certain size depending on what device I am on. Since I am using images for all of my buttons, ideally just proportionately scaling everything would be the simplest way to achieve what I am looking for. Am I missing something as far as how best to proceed with this? Thanks in advance.
You are describing Auto Layout. It is the feature specifically designed for this very purpose, i.e. to change sizes and distances of interface objects in response to the fact that the screen is a different size.
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/AutolayoutPG/Introduction/Introduction.html
However, for a size difference as great as the iPad vs. the iPhone, if you have a universal app, it sometimes makes sense to design two different interfaces. It is easy to set up the Info.plist or your initial code to load the correct interface depending on which device type this turns out to be at runtime. In fact, if you start by making a Universal app, the project will simply come with two storyboards, one for iPhone and one for iPad, which are loaded automatically.
Another option (which didn't occur to me at first because I don't write these kinds of game) is to scale a superview by applying a view transform (i.e. set its transform to a scale transform). That scales the view's coordinate system, so all its subviews will change to match, just like a drawing.

Resources