Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mitay-walle

Pages: [1]
1
NGUI 3 Documentation / Re: UITexture
« on: June 19, 2015, 02:28:58 AM »
Hello! I'm using UITexture with runtime-imported texture, for some reason it has wrong local scale after import, and I can't change it through code.
https://www.dropbox.com/s/71l3ty9udmosggc/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202015-06-19%2009.57.47.png?dl=0
In a little different situation, Anchors helped, but this is not that case.

What I've tried to do:

            image.mainTexture = texture;

            image.transform.localScale = Vector3.one;  // no effect
            transform.localScale = Vector3.one;  // no effect
            //image.height = NGUIMath.AdjustByDPI(.01f); //this changes not the local scale, but pixel size in widget
            //image.width = NGUIMath.AdjustByDPI(.01f);
            //NGUIMath.MakePixelPerfect(image.uvRect,600,300); // no effect
            //image.transform.localScale = Vector3.one;  // no effect
            transform.localScale = Vector3.one;  // no effect

My main question: How can I change local scale (in transform) of UITexture?

Pages: [1]