Search Issue Tracker
Fixed
Fixed in 2021.3.22f1, 2022.2.12f1, 2023.1.0b9, 2023.2.0a4
Votes
2
Found in
2020.3.40f1
2021.3.10f1
2022.1.17f1
2022.2.0b8
2023.1.0a11
2023.2.0a1
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
Comments (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]pxYou can calculate the value as follows:
unity-slice-scale = [your sprite pixels per unit value] / 100For 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
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- ":focus" style will not be shown when the UI element is unparented and reparented and the "Focus()" method is called without the "Blur()" method being called
- Crash on BucketAllocator::Allocate when importing TextMeshPro assets
- Playmode dropdown creates continuous "Layout update is struggling" errors at certain aspect ratios
- Editor takes a long time to open VFX Graph 'Subgraph' asset when it is heavily referenced by multiple other VFX Graphs
- "Editor Event Handler Error" error is thrown when using Terrain Tool shortcuts
Resolution Note (fix version 2023.2.0a4):
UI Elements: Added "-unity-slice-scale" USS property to UI Builder and updated drag step for some style fields
Also updated dragger manipulators for the following UI Builder property inspectors (default drag step updated from 1.0px (old value) to 0.1px (new value):
- TextShadow's Blur Radius, Offset X and Y fields
- Slice Scale field
Resolution Note (fix version 2023.1.0b9):
Fixed UUM-23969 @sebastiend@unity3d.com:
UI Elements: Added "-unity-slice-scale" USS property to UI Builder and updated drag step for some style fields
Also updated dragger manipulators for the following UI Builder property inspectors (default drag step updated from 1.0px (old value) to 0.1px (new value):
- TextShadow's Blur Radius, Offset X and Y fields
- Slice Scale field
Resolution Note (fix version 2022.2.12f1):
Fixed UUM-16141 @sebastiend@unity3d.com:
- UI Elements: Added "-unity-slice-scale" USS property to UI Builder and updated drag step for some style fields
- Also updated dragger manipulators for the following UI Builder property inspectors (default drag step updated from 1.0px (old value) to 0.1px (new value):
TextShadow's Blur Radius, Offset X and Y fields
Slice Scale field
Resolution Note (fix version 2021.3.22f1):
Fixed UUM-16142 @sebastiend@unity3d.com:
UI Elements: Added "-unity-slice-scale" USS property to UI Builder and updated drag step for some style fields
Also updated dragger manipulators for the following UI Builder property inspectors (default drag step updated from 1.0px (old value) to 0.1px (new value):
TextShadow's Blur Radius, Offset X and Y fields
Slice Scale field