Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.AutoCorrectUIDimensions Class Reference
Inheritance diagram for AC.AutoCorrectUIDimensions:

Public Attributes

RectTransform transformToControl = null
Vector2 minAnchorPoint = new Vector2 (0.5f, 0.5f)
Vector2 maxAnchorPoint = new Vector2 (0.5f, 0.5f)
bool updatePosition = true
bool updateScale = true
bool accountForSafeArea = false

Protected Member Functions

void Start ()
void OnEnable ()
void OnDisable ()
void Initialise ()
IEnumerator UpdateInOneFrame ()
void OnUpdatePlayableScreenArea ()
Vector2 ConvertToPlayableSpace (Vector2 screenPosition)

Protected Attributes

CanvasScaler canvasScaler
Vector2 originalReferenceResolution

Detailed Description

This script can re-position and re-scale a Unity UI-based Menu if the playable area is not the same as the game screen. This can be the case if an aspect ratio is enforced, or if running on a mobile device with notched features.

Member Data Documentation

◆ transformToControl

RectTransform AC.AutoCorrectUIDimensions.transformToControl = null

What RectTransform to reposition. If unset, and the Canvas is linked to an AC Menu, then this will be auto-set to the Menu's RectTransform boundary