Why is this image not sliced?

This “UniversalPanel1” is an image included in an asset I purchased; it is a small 8px x 8px image with a pre-slice set.
However, when I place this image in canvus, it does not slice.

Please see the attached image.


The screen size is 100 x 100 and this image is placed with a slice setting of 50 x 50.
However, it is not sliced, as you can see at a glance.


When I deleted the .meta file for this file and re-configured the border settings, it displayed correctly.
As you can see, the display size and border settings are the same as the first image, but the problem is solved.

As I mentioned at the beginning, this is an image from an asset I purchased.
Thus, there are hundreds or thousands of images in which this or similar conditions can occur. It is very difficult to re-set all the borders for them and to do so every time you use this asset in a new project.
So they want to know why this happened in the first place.

Did you bring in the meta files that tell this slicing? If you just dropped the image file in, it would never have anything data-wise to tell Unity how to slice it.

No, the META file is not included in the assets, nor did I bring it from another project.
It was automatically created by unity when I created the asset.

Well there’s the problem. The slicing info is in the metafile.

Either:

  1. bring in the metafile that contains the slicing info

OR…

  1. regenerate it yourself, perhaps by:

The behavior of the asset appears to be correct. The “UniversalPanel01” asset is sliced, which can be confirmed by adjusting its width, for example. When you do this, you’ll see that it’s sliced and simply enlarged.
To achieve pixel art assets in 4K resolution without uploading larger images, custom import settings were used instead of the default ones. These settings, as shown in the attached screenshot, scale the small graphic so that the pixels remain large and crisp.
However, if the .meta file is deleted, the import settings reset to their defaults. In this instance, this will cause the resliced image to appear differently.

2 Likes

it’s ok,thanks a lot