Correct map settings with Tiled For Iphone - iphone

So i am using tiled to create levels for my new iphone game.
The when creating a map with tiled for iphone the correct map size is 50x50 and tile size 32x32.
The problem is with these dimensions the tiles are to small for what i need it for.
So i have tried doubling the settings to map size 100x100 and tile size 64x64 but no luck..
Anyone familiar with doing this?
The goal is i would like the tiles to be bigger and take up more of the screen space. If you dont get the settings right, the map wont show up correctly on the screen half of it will be hanging of.

There's two things to consider: the size of your tiles must match the tile size setting in Tiled, otherwise they will not align correctly. If you double tile size to 64x64 you also have to double the size of the tileset image.
The other thing is how many tiles fit on the screen. If you divide 480 by 64 you get 7.5 meaning 7 and a half tiles fit on the screen on the horizontal direction (assuming landscape mode). If that's what you need, you'll have to make sure the tile size is clearly divisible by 480x320 respectively 1024x768 on iPad or 568x320 on widescreen devices.

Related

How do I make my 2D game responsive to different resolutions?

I making a 2D game in unity. And I want to make my game responsive to different resolutions, and when I use Canvas Scaler all my UI objects become very bigger.
if you can help please response.
thank you!
Designing UI for Multiple Resolutions
1. Using anchors to adapt to different aspect ratios
One way to keep buttons inside the screen is to anchor them to their respective corners,
One way to keep the buttons inside the screen is to change the layout such that the locations of the buttons are tied to their respective corners of the screen.
Once the buttons have been anchored to their respective corners, they stick to them when changing the resolution to a different aspect ratio.
When the screen size is changed to a larger or smaller resolution, the buttons will also remain anchored to their respective corners. However, since they keep their original size as specified in pixels, they may take up a larger or smaller proportion of the screen.
2. Scaling with Screen Size
In the Canvas Scaler component, you can set its UI Scale Mode to Scale With Screen Size. With this scale mode you can specify a resolution to use as reference. If the current screen resolution is smaller or larger than this reference resolution, the scale factor of the Canvas is set accordingly, so all the UI elements are scaled up or down together with the screen resolution.
The layouts will appear the same in different resolutions, only with a lower pixel density depending on if you scale up or down.
One thing to be aware of: It can be possible that some element are larger in landscape aspect ratio. This can be fixed if you change the Match property to 0.5 instead, it will compare both the current width to the reference width and the current height to the reference height now.
Unity Documentation

Why is my pixel art scaling wrong on other resolutions?

My pixel art assets all have a ppu of 32 and i have applied that to them all.
On 1920x1080, the resolution is fine, but most other resolutions the sprites pixels are squashed and stretched. I also have set the correct camera size using vertical resolution / PPU / 2). I have also used other formulas and they all give me the same camera size so i'm sure that's not the issue.
I have two moniters, one at 1920x1080, and one at 1360x768, and that moniter is where it scales wrong. Is there a way i can keep the pixels scaling the same across all resolutions? I have tried the pixel perfect camera and this doesn't fix my issue either.
https://imgur.com/gallery/Uf8YqNi Here is a sample of both resolutions, if you open them in a new tab and zoom in on the sprite you can see how tey get distorted in the 1360x768 screen.
Filter mode should be Point and compression None. If this doesn't fix it, then you should use Pixel Perfect camera. It will help you with the animations to be pixel perfect as well.
Window -> Package Manager -> Advanced -> Show preview packages -> 2D Pixel Perfect -> Instlal. Then you just add Pixel Perfect Camera component to your Camera.

SKTileMapNode Pixel to Pixel Aligning

I am working on a tilemap game with Apple's newish SKTileMapNode. The pixels on my tiles do not match up with the pixels on the phone display. My scale mode is set to .resizeFill. My tile's sizes are correctly labeled as 64x64 and each tile's texture's image is sized correctly.
I am using a camera that is a child of the gray circle in the attached image. I believe that the camera will create a pixel to pixel view of the screen size being used and match the resolution, but I am not sure that I can trust this. How can I get my pixels to align correctly to avoid this.
It turns out that SpriteKit's SKTileMapNode really likes assets to be optimized for all resolutions. This fixed my pixel alignment problem entirely. While this may seem obvious, I originally added #1x files in order to use an optimized texture atlas. It took more research to discover how to add different resolutions to a texture atlas.
Since it is different than normal atlases (appending ".atlas" to a folder of images), I will describe how to do so here
Go to the assets.xcassets folder and click "New Sprite Atlas." In here drag in all #2x and #3x images. Delete the [asset-name].atlas folder if you had one before, as this will not support different resolutions natively.
From here on, the atlas can be accessed just as the original [asset-name].atlas folder was accessed in code.

Image size incorrect in Unity

I have a Unity 2D project with a fixed screen size of 800x450 pixels.
I have imported a background image that is also 800x450 pixels.
When placed on the stage, the image only takes up half of the screen.
The scale of the image is set to 1,1. The Z position is 0.
Why is the image displayed too small? How can I display the image at the correct resolution?
Does this mean that I have to design all my game assets at 2x the required size? Or that I somehow have to set the scale for all imported assets at 2? What is the recommended workflow?
EDIT
I have added a screenshot of the camera settings:
I would trying making your camera orthographic, and set the size of the camera (not the transform) to be half the height that you would like it to be (225)
Also if you are looking for pixel perfect game. here is a pretty good article from Unity about how to make that work and it explains some of the camera aspect ratios and scaling
http://blogs.unity3d.com/2015/06/19/pixel-perfect-2d/

CATiledLayer not lining up the "layers"

I have a CATiledLayer in a scrollView.
The total image is 11,000 x 17,000 and I've cut that up in to tiles of 256 x 256.
When I'm in the zoomed in mode the UIScrollview works perfectly with the CATiledLayer and I can see them all flickering in to view and I can scroll to all edges of the photo.
However, I have a second level of detail which uses an image of size 1650 × 2550 which I have also cut up in to tiles of 256 x 256.
The problem I have is when I zoom out of the UIScrollView and the low res images take over the image is shifted and is surrounded by black to the bottom and right. i.e. the scroll view content size is still the same size and the image being displayed is sitting really small in the top left corner.
Do I need to do something when the level of detail changes?
It is the first time I've used the CATiledLayer so I could have missed something.
::EDIT::
I know how to explain it better. The low res tiles are being loaded and being drawn but they are being drawn at the same physical size as the high res tiles.