Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Screen Aspect#

Screen / Screen Aspect

  • Can Read

  • Cannot Write

Description#

The width of the game window divided by its height

Code#

using System;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Screen Aspect")]
    [Category("Screen/Screen Aspect")]

    [Description("The width of the game window divided by its height")]
    [Image(typeof(IconAspectRatioFitter), ColorTheme.Type.Gray)]

    [Keywords("Resolution", "Ratio", "Proportion", "Window", "Display", "Wide")]

    [Serializable]
    public class TypeNumberScreenAspect : TypeNumber
    {
        public override double Get(Args args)
        {
            int height = UnityEngine.Screen.height;
            return height != 0 ? UnityEngine.Screen.width / (double) height : 0f;
        }

        public override string ToString()
        {
            return "Screen Aspect";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.