Saving Xcode project means that adding new tile to SKTileSet makes all previous tiles blurry - swift

I have several 8x8 tiles and an SKTileSet .sks file with the tiles in it. The tile size is correctly set to 8x8. The tiles are also in the .xcassets catalog. The tiles correctly display clearly and with sharp edges, just like when you use NearestNeighbor rescaling.
The issue comes after saving the project. The tiles still work fine, but if I try to add a new tile to the tile set, all of the tiles before the save become blurry. I was expecting them to not be affected and continue displaying just like they were before saving.
I have tried many things:
Updating mac version and Xcode version (macOS 13.2, Xcode v14.2)
Reinstall Xcode
Make different projects to see if issue persists(it does)
Tinkered with numerous settings in build target as well as in Xcode itself

Related

Unity2D UI>Image doesn't show the full image and appears differently between two projects. Why is it doing this?

I added a Unity UI>Image to my project with a given source image (called Btn_OtherButton_Blue). It appears cropped in some way. It doesn't show the full button image, the top seems cut off. I added a UI>Image to a different project with the same source image and it appears differently. In that project it seems like it's using the full image uncropped.
I've compared the projects and can not find the difference. I'm new to Unity. There's probably something simple I'm missing. I have an imgur link to show what I mean.
https://imgur.com/a/nhJN3Ko
The settings seem the same to me. Is there a crop property of UI>Image that's hidden that could determine why one project shows more of the source image than the other?
compare the settings of the sourcefile of each project. it looks like the image sourcefiles are using different values for "Pixels Per Unit".

Unity CopyTexture Renders 1/4 or None of sprite

I had a previously working copy texture call that has suddenly stopped working properly (for reference I am using a slightly modified version of Spine2Ds "Sprite Attacher" that copies textures to the spine). There were no code or texture format changes it just seemed to stop working one day and even the examples from Spine stopped working (I am using the latest version of Spine).
This was the code that used to work:
Graphics.CopyTexture(source, 0, 0, (int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height, destination, 0, 0, 0, 0);
Here are watch values for the above line:
The problem is it now renders copied textures as either a grey box, or, sometimes 1/4 (always the bottom left) is rendered and the other 3 quarters are rendered as grey.
For reference here is my code trying to run the copy texture code and heres how it appears
As you can see the bottom left is rendering but the other 3 quarters are missing. For reference I am using Spine2D and even using their example scenes whenever it does a copytexture call, those textures also appear as grey.
I am a novice when it comes to GPU related bugs but if you have any suggestions on how I can debug this I am all ears. I tried changing the texture formats (both original and destination) but it didn't work out well. I can't easily go back in my git history either because there are incompatible frameworks with the unity versions so I need to solve this as it is now but I can safely say there were no local code changes that caused this isssue.
Any and all suggestions on how to debug/fix this are welcome.
It was a spine bug and it will be fixed

PNG file looks completely different inside of Unity

I purchased the "Set Builder: Back street Manhattan" with came with some png textures such as this one.
When I open the file in the browser or any editing program, it looks completely transparent except for the windows. When I drag the image into Unity, it is completely opaque bricks (which is what I want) If I duplicate the image and drag that image into Unity, it is again completely opaque bricks. If I save a copy of the image with photoshop or another application, the information that contained the bricks is lost and it is now mostly transparent, except it has some blotchy white textures which also aren't seen in the photoshop interpretation. Every texture in this folder is doing this same behavior. Are these files corrupted or compressed? How do I retain the brick information into an image editing program besides taking a screenshot within Unity ? Here is an example : of dragging images onto cubes in Unity. Left is a Photoshop copy. Right is attached image
The developer has not replied to my direct questions.
it can be your texture import format
try changing its format to true color
I found a solution in Photoshop.
Layer>layer mask>from transparency. Then right click on the layer to disable the transparency.

Unity: Strange Camera Offset for multi-monitors at different resolutions

I am creating a game (it's actually more of an application/useful software than a game) which needs to be run on multiple monitors, where all monitors are potentially different resolutions.
In the example below, you can see the primary monitor (far left) rendering a full screen camera view, just as it should. There are two other cameras set to render to monitor 2 and 3. These are activated with Display.displays [1].Activate (1600, 900, 50); (so as to set their resolutions to 1600x900).
The issue is that Unity appears to be offsetting the camera rendering so that it does not originate from the top left of the screen, but rather some way down the window. The grey area shows the area where the image is missing.
When running in the editor, the cameras render each window perfectly with no strange offsetting/cropping.
What do I need to do in order to get the standalone output to render the correct, uncropped/offset image in each of the windows, please?
If I make the resolution of all monitors the same, it renders exactly as it should do:
Annoyingly, this seems to be a bug with Unity version 5.3.x. It seems to be fixed in 5.4.x [See Bug Report Here] (I have downloaded the beta and tested it - I can confirm this to be true!). However, 5.4.x is currently in beta and you can only access it if you have Unity Pro.

dealing with different screensizes when using tiled map files (tmx)

I'm trying to learn spritekit and I'm a little confused by something. I know that I need to have #2 image files which need to be double the size of the standard ones and that once I name them properly xcode will deal with the rest. But, when dealing with tiled, do I need tiled files that are level1.tmx and level1#2.tmx
So here is what I did as a test today:
created two tilesheets, one was 32x32 and the other is 64x64 (the 2x).
create two levels in tiled, one was 64x64 tile sizes and the level size was 2048x1536 (the 2x one). I used the 64x64 tiles on that one. The other level I created was the exact same, but I created it with 32x32 tile size, which made the level size 1024x768 and I used the tilesheet that was 32x32 on it.
So now I have two tmx files and two spritesheets, for one level, on the ipad.
Am I doing this correctly? Once I start doing the iphone I will have 4 or maybe 6 sets for each level?
I assume xcode won't work the same way with tmx files if I name them level1#2x.tmx, right? If not and assuming everything I'm doing above is correct, how to do load the correct tmx file? Do I need to check for device type, then resolution and load my map file based on that for each level?
I think maybe I'm not doing this right so I wanted to stop here and ask before I get any further.
TMX files are not loaded automatically in iOS so I am guessing you are either using the SKAToolKit or the JSTileMap one of the two most popular to my knowledge. Myself and other Sprite Kit Alliance members put together the SKAToolKit so I think I can answer your questions from that point of view because it should be similar for JSTileMap too.
The short answer is build your map using 1x assets, but provide images for standard and retina in Xcode.
First you create your map using 1x assets. When the map is loaded it uses points not pixels. So for example if you make a 32x32 pixel tile map it will be treated as a 32x32 point map. When the sprites are created it pulls in the correct image based on device. If an image is named tree.png and is 32x32 it will take up the space of a 32x32(point) tile. If you have an image called tree#2x.png 64x64 iOS will use that for retina devices. Because it is an #2x image it will take up 32x32(points) but will be 64x64 pixels.
Hopefully that makes some sense. If not let me know.