Search Unity

Resize a sprite in runtime and get height and width in px

Discussion in 'Scripting' started by borjamtez, Jun 25, 2019.

  1. borjamtez

    borjamtez

    Joined:
    May 21, 2019
    Posts:
    5
    Hi there!

    Im working on a 360 - virtual tour app and I would like to implement a face blur/censor.

    I would like to put a quad with sprite renderer, and a slider to resize this object. I need the sprite size to send it to backend and blur it with python script.

    I achieve to scale this object, but the sprite size is not changing.

    Thanks!
     
  2. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    Sprite size won't change when you scale objects in scene. You need to create new texture and copy all pixels using some kind of image resize algorythm.
     
  3. borjamtez

    borjamtez

    Joined:
    May 21, 2019
    Posts:
    5

    Thanks, I will try this