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. Dismiss Notice

weird 9 slice behavior

Discussion in '2D' started by WelchCompositions, Mar 29, 2017.

  1. WelchCompositions

    WelchCompositions

    Joined:
    Sep 30, 2013
    Posts:
    29
    I've been trying to 9 slice a button and no matter what I move the borders to I get really weird results. I'm testing in a new scene with a screen overlay canvas and no transform changes on the canvas or the image.

    upload_2017-3-29_12-48-25.png
     

    Attached Files:

  2. WelchCompositions

    WelchCompositions

    Joined:
    Sep 30, 2013
    Posts:
    29
    Not that it should make a difference but I centered the button within the canvas and still poor results. Obvious scaling on edges when no scaling should happen. I'm on unity 5.5.1
    upload_2017-3-29_13-2-55.png
     
  3. WelchCompositions

    WelchCompositions

    Joined:
    Sep 30, 2013
    Posts:
    29
    I tried going to 5.6 beta and still same behavior. Here is a blank project with a test scene showing odd behavior
     

    Attached Files:

  4. pedro_oliveira

    pedro_oliveira

    Joined:
    Jan 27, 2017
    Posts:
    1
    Hello,

    I am not sure if it will work the same for you but here's what I've done:
    1. Reset Sprite Import Settings for the Button
    2. Set Sprite Mode = Single, Pixels Per Unit = 1, Mesh Type = Full Rect (thou it worked fine with Tight), Filter Mode = Bilinear, Max Size = 2048 (no overrides). And removed Advanced » Generate Mip Map
    3. On the Scene, reseted the Image, changed Source Image back to Button, Image Type = Sliced and Fill Center checked.
    4. Reset Canvas, changed Canvas Scaler to Scale With Screen Size at 1920x1080 and Reference Pixels Per Unit = 1.
    I also added an Aspect Ratio Fitter script to the Button to play around but I think it works well without it. I also made some changes because the borders were to strong for me (the Reference Pixel Per Unit). But at 100, it just looks wider.

    You can see the screenshot I took.
    Hope it helps somehow.

    Kind regards,
    Pedro
     

    Attached Files: