Questions tagged [aspect-ratio]

The ratio of the dimensions of a screen resolution. Always listed as the longer dimension first.

Filter by
Sorted by
Tagged with
0 votes
1 answer
44 views

Android Specifications : What are the integer values for "small" screen size, "normal" screen size, ldpi, mdpi, hdpi?

Android has this document where they define thee terms for screen size, and pixel density such as screenSize="small", "ldpi". Here is the link to that document: https://developer....
1 vote
1 answer
208 views

How to detect if a mobile device is a foldable phone?

There are new "foldable" mobile devices such as Samsung foldable phones. Is there any way we can write a C# script in Unity to detect if the device is a foldable phone ? I try, but can't ...
0 votes
1 answer
54 views

Will putting Screen.orientation in Update affect the performance?

If I put Screen.orientation in Update to detect whether the device is in landscape orientation, will it affect the game's performance? ...
0 votes
1 answer
63 views

When device is put in landscape mode, a cube in the corner of the screen no longer appears to face forward

I've made a cube in the corner of my screen always face forward: transform.rotation = Quaternion.LookRotation(Vector3.forward); If I hold my iPad upright, in ...
0 votes
1 answer
2k views

Keep aspect ratio on window resize in Unity

What is my problem? I have started a new 2d game project in Unity and would like to allow for resizing of the window by the player. When resizing, I don't want black bars at any of the 4 sides (I ...
0 votes
1 answer
393 views

How to stop Sprites from stretching on Mobile with different aspect ratio

On Unity 2020.3.24f1: I created a 2D Core Project and changed to build on any Android device. Added a simple 2D Circle Sprite to my Scene. The Problem: I want my Game to run in 9:16 aspect ratio all ...
1 vote
1 answer
609 views

The rightmost part of the game screen is truncated in HTML

I created a game that, when I play it in Unity, looks like this: But when I build it in WebGL, the rightmost part of the screen (with the red player character in it) is truncated: Play it in-browser ...
0 votes
0 answers
334 views

Maintain UI position with Aspect Ratio Fitter and anchor preset is set to stretch

So i have a text UI using Aspect Ratio Fitter with Aspect Mode Height Control Width and i set anchor preset to stretch upward . To make it easier to understand , i want my text to stretch upward ...
1 vote
1 answer
515 views

Unity difficulty placing text within the reference resolution of the canvas

I have a TextMeshPro GameObject, which I placed within the Canvas. The canvas is set to Scale with Screen Size and has a reference resolution of 1440x1080. The ...
  • 113
0 votes
0 answers
110 views

libgdx images go out of proportion on some devices

I'm trying to develop a simple game using libgdx. The game works perfectly on emulator ( Nexus 5x API 26 x86 ). But when I generated its apk and tested on my phone(Samsung J7), the images somehow seem ...
0 votes
0 answers
14 views

World coordinates on vertical grid game for different aspect ratios (Unity) [duplicate]

new to game development and unity so hopefully someone can help. I want to make a 2D portrait mobile game that will have a grid of constant size where units can move on in Unity. This should support ...
0 votes
0 answers
988 views

How to adapt my mobile game for different aspect ratios?

Before I start, I'd like to note that I work in the Unity Engine, but the basic theoretical stuff should be similar just about anywhere. It's not really hard to get the game's camera/World view or UI ...
0 votes
0 answers
139 views

Unity game layout problem for high-aspect Android screens

I'm trying to port over a card game I wrote some years ago into Unity (2D, Orthographic). The game objects are placed correctly when I build and run in Windows, Linux, and Mac, for all the different ...
1 vote
1 answer
165 views

Handling different aspect ratios on a 2D dodging game

I've been making a game where the player is on the ground and has to dodge objects falling to the ground. Since I'm using libGDX (But the question still applies to any other language/framework), The ...
  • 59
1 vote
0 answers
401 views

The most popular Resolutions and Aspect Ratios in Android OS 2019

I develop the game with Libgdx framework. When I tried to deal with support multiple screen resolutions it turns out that Libgdx is not following Android approach how to deal with Screen sizes and ...
2 votes
1 answer
559 views

Creating a letterbox screen for Android devices

I want that the screen looks the same on every Android device without distorting the sprites. One player should not see more of the map than another player just because they have a bigger screen or ...
1 vote
2 answers
1k views

Understanding Unity-UI Layout Element - Mininum and Preferred Size

I have been working with Unity for some time, and I am trying to get a better understand of the UI system. I am a mobile developer and am redesigning the UI but I am unable to achieve what I want. My ...
  • 293
2 votes
2 answers
2k views

How to adjust objects' coordinates and scale for different device resolutions?

I have a bunch of objects which are generated in specific coordinates, let's say in a range of -5 to +5 on the X axis. I came up with these numbers because of camera size I have in Unity editor. What ...
1 vote
1 answer
620 views

3D camera - window resolution relation

I'm having a bit of an issue when it comes to 3D- and 2D camera(s), in relation to a game's window resolution. I want to let the player choose from different window resolutions, either from a menu or ...
4 votes
1 answer
7k views

How can I get Unity to do letterbox/pillarbox to maintain aspect ratio?

I'd like my game to have the same aspect ratio at all cost, including keeping all UI elements fixed in the same place. I'm totally ok with losing screen space in the interest of fixing the aspect ...
  • 6,658
0 votes
1 answer
94 views

Scale VBO magnitudes based on aspect ratio

On my screen I have drawn a box. When I adjust my screen size (to a non 1:1 aspect ratio) I get a rectangle. This is obviously something wrong with my projection matrix. I am attempting to keep ...
0 votes
1 answer
58 views

Quality deterioration on a device

I am using Unity. When I try the game out in the IDE everything looks pretty good: But when I am trying to play the same game on a device the quality becomes a great deal worse and you can see it for ...
8 votes
2 answers
28k views

How to force keep the aspect ratio and specific resolution without stretching the output screen view?

I'm using Screen.SetResolution() But when I run in Android device, it shows the output image is stretched to fill up the full screen which I don't want. I want it to keep the aspect ratio properly. ...
1 vote
0 answers
2k views

Best base resolution for a pixelart project for bigger audience [closed]

I've been working on Top-down 2D pixel art project for quite some time. When I first started my project, I actually set application surface, display and game window to match 1:1 - with that said, the ...
  • 11
1 vote
1 answer
314 views

Make virtual joystick preserve aspect ratio Android in Unity

When I start my game on Android my virtual joysticks stops being round. Here you can see it: Here is the project on PC at the same time: Here are my UI settings for the Joystick: Please, help me ...
  • 771
1 vote
1 answer
1k views

Unity - how to switch between ratios in a Scene View?

I'm complately new to Unity, but I know what's going on, I've made some games with LibGDX earlier. In GDX, to handle all ...
  • 2,522
0 votes
1 answer
322 views

Unity2D - Horizontal Scaling to Support Various Aspect Ratios?

I am trying to work out how to support various resolutions for my Android game. I have come up with a solution, but do not know how to implement it. Automatically, I am told that Unity vertically ...
1 vote
1 answer
1k views

How to create and choose sprite sheet for different mobile screen resolution in Unity

Background We’re working on a 2D mobile game. We want to publish the game on all apple devices which at least support iOS 7 and to all android devices which at least support Android 4 OS. These ...
  • 125
1 vote
2 answers
440 views

If I want to create game for mobile and tablet on android and ios, which aspect ratio or screen resolution should I use?

Now my game is currently use 3:4 aspect ratio ,which is 480*640 , so my game has the letterbox (I don't like stretch) on my android mobile and my friend mobile. I don't like letterbox, so I have just ...
1 vote
0 answers
36 views

What will happen at a different aspect ratio and what is the most efficient and easy way of dealing it? [duplicate]

Let's say I have built a game for Android at the size of 480x854. If I test this on my device that has this resolution I suppose it will work and look property. But at a different aspect ratio will ...
4 votes
1 answer
372 views

Objects on TiledMap show different proportions/spacing on Android device

I'm a noob when it comes to programming Java apps, so I'm trying to make a very simple platformer game. All is running very well on the desktop project, but when I put the game on my Xperia, a strange ...
  • 127
0 votes
5 answers
955 views

How do you create images that work for multiple resolutions?

I'm currently doing some game development and I've been curious about this situation for many years. Let's say your game has two resolutions: 640x480 and 800x600 (using small numbers just for ...
0 votes
1 answer
305 views

Displaying whole screen image on multiple devices without stretching

In my(Android) game, all of my sprites are scaled against to a particular ratio (this 'guide' ratio stays the same regardless of the actual ratio of the screen on which they are to be displayed) - ...
  • 1,917
1 vote
1 answer
569 views

Error in projecting coordinates from FitViewport to screen in LibGDX

i'm using a FitViewport to render my "game world". Viewport virtual dimensions are fixed 400x240. I use viewport.unproject method to scale input touches from screen ...
0 votes
2 answers
876 views

Adjust bitmaps according to screen ratios on android

I always thought that pixels were square... it turns out i'm wrong, and I am quite worried by this. This means that if I draw a circle, it will be round on my screen but it could be an ellipse on ...
16 votes
1 answer
18k views

How can I prevent the viewport from stretching/distorting?

Basically, I want to know how I can remove distortion or stretching of the rendered image when the viewport/window size changes. The following images exemplify the distortion/stretching I'm talking ...
79 votes
13 answers
106k views

How do you handle aspect ratio differences with Unity 2D?

I've gotten a lot of answers to this question, but they are all generic and generally not very useful. None of the tutorials talk about aspect ratio and dealing with mobile devices and there are a ...
  • 891
11 votes
2 answers
16k views

Problem to match font size to the screen resolution in libgdx

I'm having problems to show text on my game at same size on different screens, and I did a simple test. This test consists to show a text fitting at the screen, I want the text has the same size ...
0 votes
0 answers
933 views

Scaling issues with Open GL viewport / scissor box (Trying to draw outside of viewport)

In my game I am currently scaling the viewport so it retains the ratio of my development device like so: ...
  • 1,917
11 votes
3 answers
19k views

Confusion over GLViewport

I'm hoping someone can help me understand the GLViewport and what happens when we resize it This will illustrate my confusion.... So, here I have a quad stuck in the middle of the screen. If I have ...
  • 1,917
1 vote
2 answers
2k views

Keeping ratio the same across devices on fixed screen game

My game is an Android game using OpenGL ES 2.0 (But this question could apply to any platform). I have read many questions on here regarding ratio management, and also read many tutorials outside of ...
  • 1,917
14 votes
1 answer
20k views

How to match font size with screen resolution?

So I'm working on a game using LibGDX, and I have a problem. To make my game fit most resolutions, I created a base asset for each aspect ratio, for example, a main menu background image, I made it ...
0 votes
1 answer
82 views

Why doesn't my game start in landscape mode?

I want my game to run on all Android devices in LANDSCAPE_FIXED mode, but this mode works only for some screen resolutions. ...
  • 5
2 votes
1 answer
1k views

Aspect ratio in LibGdx

I'm learning LibGdx and I need some help with the camera. Let's see, I'm making a Chu Chu Rocket! clon to start. I've loaded a TiledMap (10x10), and I've created an OrthographicCamera to show the map....
0 votes
1 answer
227 views

How can I support both multiple resolutions and multiple orientations in a game?

I am writing a mobile Android and iOS game. This game is similar to Doodle Jump, but without scrolling. In my game I display a background image that should cover the entire screen. On top of that I ...
  • 343
0 votes
2 answers
325 views

How do I make objects' speeds appear the same despite screen resolution?

I'm working on my HTML5 game with Intel XDK. I'm stuck on making all devices display the same number of frames per second. The first generation iPad has a screen resolution of 1024 pixels ...
  • 121
2 votes
2 answers
107 views

Would seam carving/liquid rescale make changing aspect ratios easier?

Seam carving is an algorithm which allows for resizing images without major distortions. I think it might help to make games which would adapt to different aspect ratios/resolutions much easier. But ...
user avatar
-1 votes
1 answer
376 views

Recommended aspect ratio for android / smartphones? [duplicate]

I'm making a game for android and would do it in 720p, but the phones got all different aspect ratios. Also thinking about a ios and windows phone port later. When the aspect ratio does not match, ...
  • 201
0 votes
0 answers
598 views

Handling 3D perspective for different aspect ratio

I have problem for supporting different aspect ratio in developing Mobile Game. I was developing on 2:3 screen which is iPhone 4 (Retina). When I use width and height for screen size and use fixed ...
2 votes
1 answer
720 views

Repositioning and resizing when i change the size of my window

I am trying to write a game. When someone resizes the window of my game, I need all the graphics i have drawn on the screen to reposition correctly so that the ratio of the graphics' width and height ...