Hi I need a panel in my UI that uses the 9 slice functionality but the only way I can seem to make a 9 Slice image is by creating a sprite. The problem with that is that I then cant seem to set the sprites z above my existing UI elements. ie its always hidden behind them even if they are on the same layer. Does anyone know how to achieve this?
Yes, but that doesn’t seem to make a difference, the sprite always sits below the UI element.
I managed to solve this by creating an additional UI layer (UI_2) above my regular UI layer and putting my sprite in there. It seems a bit overkill, but it works. I would expect the sprites order to be defined depending on its order in the hierarchy even when its in the same layer as UI elements like you say.
When you make your sprite from the atlas editor, youw ill want to make sure you click on ‘New Sliced Sprite From Selection’. Your sprite should then work as a 9-sliced image element.
Thanks but it didn’t do anything. In your example is everything an image element (ie no sprites)? I cant select a sprite to be the Texture for an image element. That seems to be the issue.
I can only select a texture, and the texture doesnt have the slicing information presumably?
Isn’t that what you wanted? A 9 sliced UI element? The UI element is referencing a sliced sprite asset. The blue button is the sliced sprite asset on a UI element.
Okay I see it now. Thanks! The problem was that I couldn’t see that I could assign a sprite to an image element because I had already assigned a texture, which in turn removes the options to add a sprite or material.