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?
我做了一个游戏。我想在iPhone和iPad(通用游戏)上使用它。我在gamescene.sks文件中设置了屏幕640x1136。当我在所有iPhone上玩游戏时,屏幕看起来很完美。但是当我在iPad上玩时,游戏画面看起来比iPad屏幕更大。如何为iPad设置屏幕?
1 个解决方案
#1
1
It all comes down to the scaleMode you are using.
这一切都归结为您正在使用的scaleMode。
You have 4 options
你有4个选择
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
第一个调整场景框架的大小,其他框架将场景保持为您指定的大小,并缩放以适合屏幕。如上所述,.Resize可调整场景大小以适合您的屏幕。如果您的初始场景是10,10,它将使iPhone 4s上的场景大小为320x480
.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
.Fill(默认值),它保持场景的坐标相同,但在x和y方向上伸展。如果你的游戏是在风景中,而你设计的是4:3的屏幕,你将在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.
.AspectFill,它保持纵横比相同,但会缩放你的场景,直到最远的边界被击中。如果您处于4:3场景的景观中,它将延伸到左右边界,使顶部和底部裁剪以保持比例。
.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.
.AspectFit,它保持纵横比相同,但会缩放你的场景,直到最近的边界被击中。如果你在4:3场景的风景中,它将延伸到顶部和底部边框,左右两侧出现黑色边框。
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)
如果您希望您的游戏在所有屏幕上显示相同的大小,最好的选择是使用.AspectFill,并围绕裁剪计划您的游戏。 (基本上不要在被裁剪的区域放置任何重要的东西)
#1
1
It all comes down to the scaleMode you are using.
这一切都归结为您正在使用的scaleMode。
You have 4 options
你有4个选择
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
第一个调整场景框架的大小,其他框架将场景保持为您指定的大小,并缩放以适合屏幕。如上所述,.Resize可调整场景大小以适合您的屏幕。如果您的初始场景是10,10,它将使iPhone 4s上的场景大小为320x480
.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
.Fill(默认值),它保持场景的坐标相同,但在x和y方向上伸展。如果你的游戏是在风景中,而你设计的是4:3的屏幕,你将在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.
.AspectFill,它保持纵横比相同,但会缩放你的场景,直到最远的边界被击中。如果您处于4:3场景的景观中,它将延伸到左右边界,使顶部和底部裁剪以保持比例。
.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.
.AspectFit,它保持纵横比相同,但会缩放你的场景,直到最近的边界被击中。如果你在4:3场景的风景中,它将延伸到顶部和底部边框,左右两侧出现黑色边框。
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)
如果您希望您的游戏在所有屏幕上显示相同的大小,最好的选择是使用.AspectFill,并围绕裁剪计划您的游戏。 (基本上不要在被裁剪的区域放置任何重要的东西)