Skip to main content
43 votes
Accepted

What makes scaling pixel art different than other images?

Scaling by Whole Numbers Scaling by 2x, 3x...nx is simple - each pixel just becomes an nxn square of pixels, and the look of the original sprite is perfectly preserved (including all the sharp lines, ...
DMGregory's user avatar
  • 135k
36 votes
Accepted

From a game design point of view, what are the implications of using realistic distances in an open world map?

Almost no game uses realistically scaled maps for cities. The problem with creating cities which are even close to the size of real cities is: Maps become difficult for the player to navigate. They ...
Philipp's user avatar
  • 120k
22 votes

Scale camera to fit screen size unity

You can adjust the camera's height so it scales with the width of the screen like so: (Place this script on your Camera object) ...
DMGregory's user avatar
  • 135k
21 votes
Accepted

Scaling my pixel art platformer from 720p to 1080p

For anyone wondering why this is an issue for pixel art, here's a quick example using a scene from Super Mario World: If we just scale a pixel art game from 720 to 1080 at runtime (the way a typical ...
DMGregory's user avatar
  • 135k
8 votes

From a game design point of view, what are the implications of using realistic distances in an open world map?

You've already removed the main negative of a 1:1 scale map by focusing it on a small area instead of an entire city or countryside, but a citadel is still on the large side. The biggest issue here is ...
user3757614's user avatar
7 votes
Accepted

How to scale LibGdx TextButton?

A little late but to answer my own question, you have to setTransform(true) if you're scaling a Button or ...
Neerkoli's user avatar
  • 479
5 votes
Accepted

What are some standard stair dimensions for good level navigation?

Architecture in FPS games differs from real life in a number of ways, including: Much wider interior spaces More straight sections, less turns Less vertical movement All of this to accommodate the ...
congusbongus's user avatar
  • 14.8k
4 votes
Accepted

How to scale major and minor radius of a quarter torus

To my knowledge, this is not possible using a transformation matrix since matrices represent linear transformations and the transformation you are asking for isn't linear. The answer in this SO ...
wychmaster's user avatar
3 votes

Scaling my pixel art platformer from 720p to 1080p

Elaborating specifically on @DMGregory's option of creating alternate assets at a different resolutions: The best solution I know of is probably the least use to you at this this point: develop your ...
Pikalek's user avatar
  • 12.4k
3 votes
Accepted

How to keep sprite on screen while increasing its width to screen width

This is actually very simple. All you need to do is determine the Camera Bounds, and then set the final resting position of your sprite, based on these bounds. So, you would have the start position ...
jgallant's user avatar
  • 8,424
3 votes

How to do 1.5x scaling for pixel art where only one dimension has to scale?

So I figured it out. I imagine this is common knowledge but I couldn't find it so I'll leave it here. The solution for me is to make people fit in 32x32, everything else scales relative to humans. ...
Péter Simon's user avatar
3 votes
Accepted

Object scales strangely when setting y rotation after parenting

When you nest objects in the Hierarchy, all the transformations applied to the parent get applied to its children. That means that if a parent has a non-uniform scale applied, its child objects will ...
DMGregory's user avatar
  • 135k
3 votes

Stopping the texture2D from stretching in RawImage

Use native unity component: Use AspectRatioFilter on the gameObject containting the rawImage, and tweek parameters as you wish.
Ugo Hed's user avatar
  • 281
3 votes
Accepted

Unity3D: Convert all game objects to same size irrespective of it's scale

Untested, and completely from memory, but something kind of along these lines should work. I'll test it tonight when I have access to Unity. ...
sirreldar's user avatar
  • 254
3 votes
Accepted

Invert parent transform (doesn't work for combination of rotation and scale)

A 4x4 homogeneous matrix can represent any affine transformation. That is, any combination of: Translation by any offset Rotation around any axis by any angle Scale along multiple arbitrary axes by ...
DMGregory's user avatar
  • 135k
3 votes

Thin lines appear differently even though they are the same height

The issue, as other folks have pointed out, is that Unity is doing ~the best it can with the information it has. Because the reference size of your UI and the actual size of the screen are different,...
Mhin Ra's user avatar
  • 31
3 votes
Accepted

How screen scaling works in Unity?

By default, Unity scales the camera view of your 3D world to fit the height of the window. That simple rule is the only thing happening in both of your examples: When you've fixed the aspect ratio of ...
DMGregory's user avatar
  • 135k
2 votes
Accepted

Looking for a dirty pseudo 3D trick

Wouldn't something like this do? if y > 128 then: set scale: (Sprite.Y - 128) / Scalerate
Thomas's user avatar
  • 1,209
2 votes
Accepted

Hard edges with non power of 2 images in OpenGL

TL;DR: There is no guarantee of pixel-perfectness in OpenGL, but try adding (0.375f, 0.375f) of a pixel to your render coordinates. This magic offset is "expected" by many drivers to render pixel-...
Stephane Hockenhull's user avatar
2 votes

How do I work out what resolution my backgrounds should be?

Judging by what you are trying to accomplish, there isn't a size that would work, as it would require a texture many times the size of your screen resolution. You have three options in this situation:...
jzx's user avatar
  • 3,815
2 votes
Accepted

How do I work out what resolution my backgrounds should be?

As I understand, your game window has a size of 1280x720 and the texture has 400x225. This is how this setup looks like in <...
Jacob's user avatar
  • 2,552
2 votes

Unity: How to resize a game object for a certain amount of time?

GameObject originPlayer = new GameObject(); originPlayer = player; this doesn't do what you think it does. instead you want to save the just the original scale ...
ratchet freak's user avatar
2 votes
Accepted

Confused by scaling, units, and more

When your game is rather UI-heavy (you have lots of buttons, text fields and containers which hold card images) then you might want to consider to build most of your game with the UI system. It is ...
Philipp's user avatar
  • 120k
2 votes

How to scale an object in one direction without moving the opposite edge?

The pivot of your object is at it's center. So to keep the bottom left corner in the same position, you need to move the object up and to the right by: (bigSize / 2.0) - (originalSize / 2.0) ...
Evorlor's user avatar
  • 5,803
2 votes
Accepted

How can I convert screen coordinates from a click to 2D scaled world coordinates?

You're almost there. The theory: for each "transform" you apply to the world coordinates to turn them into screen coordinates, you need to undo each one of them. You have three transforms. The <...
amitp's user avatar
  • 6,046
2 votes
Accepted

Scaling a rotated child with parent-child transforms

After some experiments, I figured this out, and as was noticed in the comments to my question it was not to do with my matrix multiplication order, but rather something else entirely. After ...
DavidColson's user avatar
2 votes
Accepted

Canvas not scaling to screen size

It looks to me like your code is placing things in a grid that you've built in world space. The canvas scaler component doesn't help if your grid is in world space. Instead of manually creating a grid,...
Kevin's user avatar
  • 6,234
2 votes
Accepted

How do I scale my spell target indicator to match the radius of OverlapSphere

The default Plane primitive in Unity has a width of 10 units, so its center-to-edge distance is 5 units. So if you want the edges of your plane to kiss the edges of your OverlapSphere test, you'll ...
DMGregory's user avatar
  • 135k
2 votes
Accepted

How do I set the size of a single 'unit' in my game?

The length units, for 3D graphics, are whatever. As long as they are internally consistent, it does not matter. For graphics. For physics units matter. However, you do not set the units. There is ...
Theraot's user avatar
  • 27.2k

Only top scored, non community-wiki answers of a minimum length are eligible