Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

sprite editor doesn't 9 slice

Discussion in 'UGUI & TextMesh Pro' started by ChironeV, Jun 16, 2015.

  1. ChironeV

    ChironeV

    Joined:
    Jul 26, 2014
    Posts:
    9
    I tried to make a button that would do the whole 9 slice thing. So... I selected the image, made sure it was Texture Type Sprite (2D and UI) and hit the Sprite Editor button.
    I made the slices and hit apply.
    Then nothing happened.
    The button the image was on was still stretched and selecting Fill Centre didn't make the middle disappear...

    Am I missing something? Why doesn't this work the way I was told it would work?
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    Make one slice of the whole thing, then use the green grips to pull them in and make the 9 slice. It stretches each "big" slice based on the green internal ones.
     
  3. ChironeV

    ChironeV

    Joined:
    Jul 26, 2014
    Posts:
    9
    I switched the Sprite Mode to Multiple so the blue border would show up. I then fiddled with the green border and it barely did anything.. Untitled-1.jpg
     
  4. DWilliams

    DWilliams

    Joined:
    Jan 12, 2015
    Posts:
    63
    If your sliced corners are larger than the size of your button it'll look weird. If possible you might slice your corners smaller and/or make the button larger and I think it'll look ok.
     
  5. ChironeV

    ChironeV

    Joined:
    Jul 26, 2014
    Posts:
    9
    Hmm...

    The sliced corners are smaller than the picture altogether. None of the green edges go past where they can go. I believe in the picture I posted above the little rectangle with the green anchor points is the bit that should be stretching.
     
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,384
    Move the slices to the tanget of the round part of the corner. You want the corners to be slices as small as possible and the center as large as possible.
     
  7. ChironeV

    ChironeV

    Joined:
    Jul 26, 2014
    Posts:
    9
    Oh I get it. It was really weird because the button was smaller than the picture itself so it didn't do things as I expected. Otherwise, if I had of made the button bigger it would have worked how I expected.
    Thanks guys!
     
  8. LyveIG

    LyveIG

    Joined:
    Jan 8, 2015
    Posts:
    15
    Also note that you have to select "sliced" as type in the Image component, otherwise it will be treated as an image without 9-slicing
     
  9. ChironeV

    ChironeV

    Joined:
    Jul 26, 2014
    Posts:
    9
    Thanks LyvelG. It was selected as sliced in the Image component :)