My 9-Slice seems to be broken?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I’m trying to create an ImageLabel using 9-slice since I have a gradient that I’d like to support multiple resolutions on.

  2. What is the issue? My 9-slice doesn’t seem to be scaling correctly:

  3. What solutions have you tried so far? Playing with the SliceScale value doesn’t seem to work. The screenshot above is with a SliceScale of 0.3

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

I’m aware this doesn’t belong in scripting support, however I can’t post to the bugs forum and I can’t find a more appropriate help subforum

1 Like

For those who are curious, a tilted gradient seems to do even worse:

Huge image

RobloxStudioBeta_Z8xOUN7fSM

It’s like 9-Slice is prioritizing the top-left corner, instead of the center of the image.

Future googlers looking for an answer: Solved it myself. Roblox’s 9-slize seems to have issues if your slice is smaller then the actual decal.

SliceScale makes things smaller but doesn’t fix the issue if your actual slice is still smaller then the provided asset.

That is the “intended” behavior of slices. It can be unintuitive, but the solution would be changing it so that the red lines are all in the middle rather than out on the edges. I believe this has to do with the way things are calculated where the square in the middle of the red slices is ignored, and so the color seems to “jump” from the top slice color to the bottom slice color in situations like this.

It would be nice to make 9-slice work the way it does in pretty much any other engine I know of, where the middle square - I.E. the actual location of the content, is calculated first, and the rest of the slice is resized around that. Things like decals and middle-of-the-asset designs scale much more smoothly in cases like that, whereas Roblox forces you to use a bunch of ClipsDescendants frames to make things scale the way they should.
Almost makes me want to make my own hack of 9-Slice that makes it work the way it does everywhere else.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.