D
D
Dmitry Korolev2018-05-26 13:10:56
Unity
Dmitry Korolev, 2018-05-26 13:10:56

How to know if an image in spriterenderer is blurry?

I have a th that contains a spriterenderer that had its scaling changed.
How do you know if an image is blurry from its original resolution?
I create through the inspector photos in the scene and make them height in world space the same size.
as a result, I can get that the photo was not of sufficient resolution and turned out to be blurry.
how to find out in runtime that it is blurry and add a frame to the image to return the image resolution and leave the canvas size alone?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Korolev, 2018-05-28
@adressmoeistranici

and the answer is simple)

bool QualityCalculation()
  {
    float factor = this.GetComponent<SpriteRenderer>().bounds.size.y / this.sprite.bounds.size.y;
    if (factor > 1f)
      return true;
    return false;
  }

if it was increased true, if equal or decreased false

S
Suren, 2018-05-26
Jagaryan @saylar

In theory, Unity preserves the quality of the sprite

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question