Hi, so I have this code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(RectTransform))]
public class SafeAreaFilter : MonoBehaviour
{
private void Awake() {
var rectTransform = GetComponent<RectTransform>();
var safeArea = Screen.safeArea;
var anchorMin = safeArea.position;
var anchorMax = anchorMin + safeArea.size;
anchorMin.x /= Screen.width;
anchorMin.y /= Screen.height;
anchorMax.x /= Screen.width;
anchorMax.y /= Screen.height;
rectTransform.anchorMin = anchorMin;
rectTransform.anchorMax = anchorMax;
}
}
And I just create a new object, attach the script to it and put all the elements as child of that object to filter them so they dont overlap on the safe area…
And it does this:
It leaves a blank area above and I want to stretch the Banner above so I can fill the safe area.
How can I do it? Hope you can help me out, guys.