How to make sprite in full screen (Independent dimension, univ?
1 answer
I understand it is about Canvas / Image
If you manually set, without a C # script, then:
For the
RectTransformcomponent, select the preset:stretch(lower right corner)Put:
Left/Top/Right/BottomPositions to Zero- Anchors minX = minY = 0, maxX = maxY = 1
- Pivot for X and Y set equal to 0.5
If through a script, it will be something like this:
public RectTransform panelRectTransform; void Start() { panelRectTransform.anchorMin = new Vector2(0, 0); panelRectTransform.anchorMax = new Vector2(1, 1); panelRectTransform.pivot = new Vector2(0.5f, 0.5f); // и прочие атрибуты установить если надо } In general, according to the UI, it is a good idea to read about it, including about:
http://docs.unity3d.com/ScriptReference/RectTransform-anchorMin.html http://docs.unity3d.com/ScriptReference/RectTransform-anchorMax.html http://docs.unity3d.com/ScriptReference/RectTransform-pivot. html
video https://unity3d.com/en/learn/tutorials/modules/beginner/ui/rect-transform?playlist=17111
|

