Search Issue Tracker

Active

Under Consideration for 2021.3.X, 2022.2.X, 2023.1.X

Unknown (hidden) 2020.3.X, 2022.1.X

Votes

2

Found in

2020.3.40f1

2021.3.10f1

2022.1.17f1

2022.2.0b8

2023.1.0a11

Issue ID

UUM-15680

Regression

Yes

[UI Builder] The border of VisualElement is not created when slicing a pixel art sprite

--

-

Reproduction steps:

# Open the attached project “UI_Toolkit_Slicing.zip“
# In the UI Builder window compare the two UI elements (the Button and the VisualElement)

Expected result: the VisualElement holds a sprite and has a 1px border like the Button element
Actual result: the VisualElement does not have a 1px border

Reproducible with: 2020.3.40f1, 2021.2.18f1, 2021.3.10f1, 2022.1.17f1, 2022.2.0b8, 2023.1.0a11
Not reproducible with: 2021.2.17f1

Reproduced on: Windows 10 Pro

Note: the issue reproduces both in the Player and in the Editor

  1. Resolution Note (2022.1.X):

    2022.1.X fixes replaced with 2022.2.X port.

  2. Resolution Note (2020.3.X):

    UI Builder package fixes not supported anymore. Please use the editor (2021LTS or more recent)

Comments (1)

  1. BusyRoots

    Oct 16, 2022 13:33

    Since the Unity beta version 2022.2.0b10 one can use the uss style property:
    -unity-sclice-scale: [value]px

    You can calculate the value as follows:
    unity-slice-scale = [your sprite pixels per unit value] / 100

    For example for a sprite with a pixels per unit value of "16" you set -unity-slice-scale: 0.16px
    in the uss style sheet that is attached to the UI element, which uses this sprite (and was sliced with the sprite editor).

    For more details see: https://forum.unity.com/threads/how-does-slicing-in-ui-tookkit-works.1235863/#post-8517644

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.