Set the screen for Universal devices ( iPhone and iPad ) - xcode

I made a game. I want to use it on iPhone and iPad(Universal game). I set screen 640x1136 in gamescene.sks file. When I play the game on all of iPhone, screen is seems perfect. But when I play on iPad, game screen looks bigger than iPad screen. How can I set screen for iPad?

It all comes down to the scaleMode you are using.
You have 4 options
This first 1 resizes your scene frame, the others keep the scene at the size you specified and scale to fit the screen.
.Resize, as stated, resizes your scene to fit your screen. If your initial scene is 10,10, it will make the scene size 320x480 on an iPhone 4s
.Fill (Default), which keeps the coordinates of your scene the same, but stretches in the x and y direction. If your game was in Landscape, and you design for a 4:3 screen, you will create a fat effect when going to 16x9
.AspectFill, which keeps the aspect ratio the same, but will scale your scene till the furthest borders are hit. If you are in landscape with a 4:3 scene, it will stretch to the left and right borders, making the top and bottom cropped to maintain the ratio.
.AspectFit, which keeps the aspect ratio the same, but will scale your scene till the nearest borders are hit. If you are in landscape with a 4:3 scene, it will stretch to the top and bottom borders, making black borders appear on left and right.
If you want your game to appear the same size on all screens, your best bet is to use .AspectFill, and plan your game around the cropping. (Basically do not put anything important in an area that gets cropped)

Related

Android OpenGL ES rotating screen

I use Gaussian blur to achieve the lighting effect.
On android, after rotating the screen, the first half of the screen is normal, and the second half of the screen is jagged.
This problem has also appeared on some iOS phones.
I don't know what the problem is.
I used fbo, texture buffering, depth buffering, and stencil buffering, and I recreated them with new dimensions each time I rotated the screen.
Ask what is the problem?

SKCameraNode positioning on Mac: non-retina vs retina

I have a game that I’m porting from iOS to MacOS. On iOS, everything functions as it should on retina and non-retina devices. On Mac, it’s a different story.
I have two class properties: upperCameraPos and lowerCameraPos
The game is in a window and the scene is twice the height of this window’s content view (SKView). When the game starts. the camera node is positioned at lowerCameraPos, revealing the bottom half of the scene. When a button is pressed, SKAction’s moveToPoint: method is used to scroll the scene up, revealing the top half. On retina and 4K Macs, this works as expected.
However, on non-retina Macs (tested on late ’07 iMac & late ’08 MacBook), the same code for setting the camera’s initial position does not reveal the lower half of the scene, but rather shows the middle of the scene (which is the camera's default position).
I’ve done a considerable amount of searching and haven’t found any explanation for this. Does anyone know if there are any issues between retina & non-retina when positioning a camera node in a scene on Mac?
I figured out what I was doing wrong. I had the scene's scale mode set to SKSceneScaleModeAspectFill. After changing the scale mode to SKSceneScaleModeResizeFill, the camera node now scales to the correct parts of the scene regardless of whether the screen is retina or non-retina.

SceneKit - Fix screen frame to camera edges

I'm working on a app that renders a 3D scene that simulates a real space into an iPhone making its screen become a hollow box, as seen in the sketch below:
(note the camera position order down below)
The problem is on how to calculate the camera parameters to make the box look real fixed to the screen edges.
Is this feasible through SceneKit?
In this configuration the camera's zNear plane corresponds to the screen of the iPhone. From that you can can derive a z position from the camera's field of view and the screen's width (see here).

Optimal WP7 bitmap drawing with XNA

I want to display a bitmap on a WP7 in vertical position, but it rotates it 90 degrees and coordinates are in landscape position. Is it possible to make WP7 display everything in vertical mode and make coordinates starting from top left corner in vertical mode? If not, whats the best way to display my bitmaps in vertical mode? Should I rotate my bitmaps when I design them, or should i use rotation in my drawing functions? I use XNA spriteBatch.Draw to draw my bitmaps, but it has some advanced rotation techniques that I don't understand.
XNA apps are based on the assumption that the game will be displayed in landscape mode. Whether it's easier/better for you to rotate things at design time or when displayign them in the app will depend on various factors, including: what the game does; your preferences; the number of items; the impact on movement calculations; etc...

Top/bottom black stripes for non wide screens in DirectX

I need to put black stripes up and down for full screen rendering when wide resolutions are not supported.
Example: for 1280x1024 resolution I need to render in 1280x720 and put black stripes to fill the screen up to 1280x1024
I do believe that the thing you need can be achieved with a viewport change, check out http://msdn.microsoft.com/en-us/library/windows/desktop/bb206341(v=vs.85).aspx
make your backbuffer the size of the screen resolution (eg: 1280x1024), then render every to a texture (of 1280x720) and render that texture to the center of the screen, after all post-processing. this is probably not the most efficient solution, but its a starting point.
A better solution is actually making your system work on 4:3 resolutions, users would probably enjoy that more than a letterboxed view, and it should be to difficult.

Resources