Search Unity

How to align pixel art with UI system ?

Discussion in 'UGUI & TextMesh Pro' started by RustyCrow, Jul 29, 2019.

  1. RustyCrow

    RustyCrow

    Joined:
    Feb 28, 2014
    Posts:
    43
    Hello devs, I am trying to create a score effect where i stack meats on a plate using the UI system. So the idea is i just offset the meat image by X * per meat amount right? Have a look at the images below.

    First image is from inside the Unity editor and second image is a pixel art editor(desired result).
    I have been trying to figure out the distance(X) i need to make the pixel art align properly, but can't seem to identify the issue. It might work for 1 type of meat but then another type gets this awkward position.

    I know i can make sprites that are offset inside of the pixel art editor and just layer them on top of each other but the score can reach > 1000 so that means 1000 of sprites.

    So if anyone knows how to move an image element by 1 pixel art pixel so the art aligns properly pleas share your thoughts, i tried asking on the Unity Answers but i got nothing so i am gonna try my luck here before i scrap this effect.

    My images sizes match the PPU(32) and canvas is set to pixel perfect. Images width/hight is 128 with Aspect ratio preserved.

    UnityUIPixel.PNG Pedit.PNG