Search Unity

Draw a perfect ring

Discussion in '2D' started by Djo_krd, Aug 12, 2019.

  1. Djo_krd

    Djo_krd

    Joined:
    Sep 6, 2017
    Posts:
    31
    Hello.
    I want to draw a small 2D ring that will expand over time, but at the same time do not lose quality and remain constant in thickness.
    I trying to draw a ring in photoshop, import it as sprite and start scaling it - quality was poor and thickness is not constant.
    How can I achieve my goal?
    Thanx in advance!
     
  2. migueltuliompg

    migueltuliompg

    Joined:
    Feb 12, 2018
    Posts:
    63
    I'm a bit late but have you tried vector graphics? I think there's a package that lets you import vector graphics.
     
    Djo_krd and LiterallyJeff like this.
  3. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    Could be done with a LineRenderer by generating positions around a circle, then scaling the line renderer object. Could also probably be done using Unity's Create -> Sprite editor option to make a procedural circle and then masking it with an inner circle. Could also be done using a material that renders rings.
     
    Last edited: Aug 14, 2019
    Djo_krd and migueltuliompg like this.
  4. Djo_krd

    Djo_krd

    Joined:
    Sep 6, 2017
    Posts:
    31
    is there any free packages for importing svg? do you mean unity asset store?
     
  5. Djo_krd

    Djo_krd

    Joined:
    Sep 6, 2017
    Posts:
    31
    I will try that, thanx!
     
  6. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    Unity has "Vector Graphics" package built-in, you can install it via the package manager window if you use the "advanced" dropdown and enable preview packages.
     
    migueltuliompg likes this.
  7. Djo_krd

    Djo_krd

    Joined:
    Sep 6, 2017
    Posts:
    31
    I enable show preview, but Loading packages loops forever and there is no Vector Graphics package available.
    upload_2019-8-14_20-18-5.png
     

    Attached Files:

  8. migueltuliompg

    migueltuliompg

    Joined:
    Feb 12, 2018
    Posts:
    63
    Try selecting "All packages" and "Preview packages" multiple times. That's what I had to do to get it to show up.
     
  9. Djo_krd

    Djo_krd

    Joined:
    Sep 6, 2017
    Posts:
    31
    I download vector graphics package manually and import my svg circle, but how to animate it shape? I dont want animate scale, because it change thickness.