Search Results for

    Show / Hide Table of Contents

    Class UICanvas

    Root of the UI structure. Renders GUI and handles input events forwarding.

    Inheritance
    System.Object
    Object
    SceneObject
    Actor
    UICanvas
    Implements
    ISerializable
    Inherited Members
    Actor.SetLayerRecursive(Int32)
    Actor.SetLayerNameRecursive(String)
    Actor.HasTag()
    Actor.HasTag(Tag)
    Actor.HasTag(String)
    Actor.AddTag(Tag)
    Actor.AddTagRecursive(Tag)
    Actor.RemoveTag(Tag)
    Actor.SetParent(Actor, Boolean, Boolean)
    Actor.GetChild(Int32)
    Actor.GetChild(String)
    Actor.GetChild(Type)
    Actor.GetChildren(Type)
    Actor.DestroyChildren(Single)
    Actor.GetScript(Int32)
    Actor.GetScript(Type)
    Actor.GetScripts(Type)
    Actor.AddMovement(Vector3)
    Actor.AddMovement(Vector3, Quaternion)
    Actor.GetWorldToLocalMatrix(Matrix)
    Actor.GetLocalToWorldMatrix(Matrix)
    Actor.OnDebugDraw()
    Actor.OnDebugDrawSelected()
    Actor.GetPrefabRoot()
    Actor.FindActor(String)
    Actor.FindActor(Type, Boolean)
    Actor.FindActor(Type, String)
    Actor.FindActor(Type, Tag, Boolean)
    Actor.FindScript(Type)
    Actor.HasActorInHierarchy(Actor)
    Actor.HasActorInChildren(Actor)
    Actor.IntersectsItself(Ray, Single, Vector3)
    Actor.Intersects(Ray, Single, Vector3)
    Actor.LookAt(Vector3)
    Actor.LookAt(Vector3, Vector3)
    Actor.LookingAt(Vector3)
    Actor.LookingAt(Vector3, Vector3)
    Actor.ToBytes(Actor[])
    Actor.FromBytes(Byte[])
    Actor.FromBytes(Byte[], Dictionary<Guid, Guid>)
    Actor.TryGetSerializedObjectsIds(Byte[])
    Actor.ToJson()
    Actor.FromJson(String)
    Actor.Clone()
    Actor.OnEnable()
    Actor.OnDisable()
    Actor.OnParentChanged()
    Actor.OnTransformChanged()
    Actor.OnActiveChanged()
    Actor.OnActiveInTreeChanged()
    Actor.OnOrderInParentChanged()
    Actor.OnStaticFlagsChanged()
    Actor.OnLayerChanged()
    Actor.OnBeginPlay()
    Actor.OnEndPlay()
    Actor.AddStaticFlags(StaticFlags)
    Actor.RemoveStaticFlags(StaticFlags)
    Actor.SetStaticFlag(StaticFlags, Boolean)
    Actor.HasStaticFlag(StaticFlags)
    Actor.ResetLocalTransform()
    Actor.AddChild(Type)
    Actor.AddChild<T>()
    Actor.GetChild<T>()
    Actor.TryGetChild<T>(T)
    Actor.GetOrAddChild<T>()
    Actor.AddScript(Type)
    Actor.AddScript<T>()
    Actor.GetScript<T>()
    Actor.TryGetScript<T>(T)
    Actor.FindScript<T>()
    Actor.FindActor<T>(Boolean)
    Actor.FindActor<T>(String)
    Actor.FindActor<T>(Tag, Boolean)
    Actor.GetChildren<T>()
    Actor.GetScripts<T>()
    Actor.RotateAround(Vector3, Vector3, Single, Boolean)
    Actor.ToString()
    Actor.Children
    Actor.Tags
    Actor.Layer
    Actor.Name
    Actor.IsActive
    Actor.StaticFlags
    Actor.PerInstanceRandom
    Actor.LocalPosition
    Actor.LocalOrientation
    Actor.LocalScale
    Actor.Sphere
    Actor.Box
    Actor.BoxWithChildren
    Actor.EditorBox
    Actor.EditorBoxChildren
    Actor.HasContentLoaded
    Actor.IsPrefabRoot
    Actor.IsStatic
    Actor.IsTransformStatic
    Actor.WorldToLocalMatrix
    Actor.LocalToWorldMatrix
    SceneObject.SetParent(Actor, Boolean)
    SceneObject.LinkPrefab(Guid, Guid)
    SceneObject.BreakPrefabLink()
    SceneObject.GetNamePath(Char)
    SceneObject.IsDuringPlay
    SceneObject.HasParent
    SceneObject.HasPrefabLink
    SceneObject.PrefabID
    SceneObject.PrefabObjectID
    Object.__unmanagedPtr
    Object.__internalId
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [ActorContextMenu("New/UI/UI Canvas")]
    [ActorToolbox("GUI")]
    [Unmanaged]
    public sealed class UICanvas : Actor, ISerializable

    Constructors

    UICanvas()

    Initializes a new instance of the UICanvas class.

    Declaration
    public UICanvas()

    Fields

    CalculateRay

    The current implementation of the UICanvas.CalculateRayDelegate used to calculate the mouse ray in 3D from the 2D location. Cannot be null.

    Declaration
    public static UICanvas.CalculateRayDelegate CalculateRay
    Field Value
    UICanvas.CalculateRayDelegate

    Properties

    Bounds

    Gets the world-space oriented bounding box that contains a 3D canvas.

    Declaration
    public OrientedBoundingBox Bounds { get; }
    Property Value
    OrientedBoundingBox

    Distance

    Gets or sets the distance from the RenderCamera to place the plane with GUI. If the screen is resized, changes resolution, or the camera frustum changes, the Canvas will automatically change size to match as well.

    Declaration
    [EditorOrder(60)]
    [Limit(0.01F, 3.40282347E+38F, 1F)]
    [EditorDisplay("Canvas", null)]
    [VisibleIf("Editor_IsCameraSpace", false)]
    [Tooltip("Distance from the RenderCamera to place the plane with GUI. If the screen is resized, changes resolution, or the camera frustum changes, the Canvas will automatically change size to match as well.")]
    public float Distance { get; set; }
    Property Value
    System.Single

    GUI

    Gets the canvas GUI root control.

    Declaration
    public CanvasRootControl GUI { get; }
    Property Value
    FlaxEngine.GUI.CanvasRootControl

    IgnoreDepth

    Gets or sets a value indicating whether ignore scene depth when rendering the GUI (scene objects won't cover the interface).

    Declaration
    [EditorOrder(30)]
    [EditorDisplay("Canvas", null)]
    [VisibleIf("Editor_Is3D", false)]
    [Tooltip("If checked, scene depth will be ignored when rendering the GUI (scene objects won't cover the interface).")]
    public bool IgnoreDepth { get; set; }
    Property Value
    System.Boolean

    Is2D

    Gets a value indicating whether canvas is 2D (screen-space).

    Declaration
    public bool Is2D { get; }
    Property Value
    System.Boolean

    Is3D

    Gets a value indicating whether canvas is 3D (world-space or camera-space).

    Declaration
    public bool Is3D { get; }
    Property Value
    System.Boolean

    NavigateDown

    The input action for performing UI navigation Down (from Input Settings).

    Declaration
    [EditorOrder(520)]
    [EditorDisplay("Navigation", "Navigate Down")]
    [Tooltip("The input action for performing UI navigation Down (from Input Settings).")]
    public InputEvent NavigateDown { get; set; }
    Property Value
    InputEvent

    NavigateLeft

    The input action for performing UI navigation Left (from Input Settings).

    Declaration
    [EditorOrder(530)]
    [EditorDisplay("Navigation", "Navigate Left")]
    [Tooltip("The input action for performing UI navigation Left (from Input Settings).")]
    public InputEvent NavigateLeft { get; set; }
    Property Value
    InputEvent

    NavigateRight

    The input action for performing UI navigation Right (from Input Settings).

    Declaration
    [EditorOrder(540)]
    [EditorDisplay("Navigation", "Navigate Right")]
    [Tooltip("The input action for performing UI navigation Right (from Input Settings).")]
    public InputEvent NavigateRight { get; set; }
    Property Value
    InputEvent

    NavigateSubmit

    The input action for performing UI navigation Submit (from Input Settings).

    Declaration
    [EditorOrder(550)]
    [EditorDisplay("Navigation", "Navigate Submit")]
    [Tooltip("The input action for performing UI navigation Submit (from Input Settings).")]
    public InputEvent NavigateSubmit { get; set; }
    Property Value
    InputEvent

    NavigateUp

    The input action for performing UI navigation Up (from Input Settings).

    Declaration
    [EditorOrder(510)]
    [EditorDisplay("Navigation", "Navigate Up")]
    [Tooltip("The input action for performing UI navigation Up (from Input Settings).")]
    public InputEvent NavigateUp { get; set; }
    Property Value
    InputEvent

    NavigationInputRepeatDelay

    The delay (in seconds) before a navigation input event starts repeating if input control is held down (Input Action mode is set to Pressing).

    Declaration
    [EditorOrder(505)]
    [EditorDisplay("Navigation", "Input Repeat Delay")]
    [Tooltip("TheThe delay (in seconds) before a navigation input event starts repeating if input control is held down (Input Action mode is set to Pressing).")]
    public float NavigationInputRepeatDelay { get; set; }
    Property Value
    System.Single

    NavigationInputRepeatRate

    The delay (in seconds) between successive repeated navigation input events after the first one.

    Declaration
    [EditorOrder(506)]
    [EditorDisplay("Navigation", "Input Repeat Rate")]
    [Tooltip("The delay (in seconds) between successive repeated navigation input events after the first one.")]
    public float NavigationInputRepeatRate { get; set; }
    Property Value
    System.Single

    Order

    Gets or sets the canvas rendering and input events gather order. Created GUI canvas objects are sorted before rendering (from the lowest order to the highest order). Canvas with the highest order can handle input event first.

    Declaration
    [EditorOrder(14)]
    [EditorDisplay("Canvas", null)]
    [Tooltip("The canvas rendering and input events gather order. Created GUI canvas objects are sorted before rendering (from the lowest order to the highest order). Canvas with the highest order can handle input event first.")]
    public int Order { get; set; }
    Property Value
    System.Int32

    ReceivesEvents

    Gets or sets a value indicating whether canvas can receive the input events.

    Declaration
    [EditorOrder(15)]
    [EditorDisplay("Canvas", null)]
    [Tooltip("If checked, canvas can receive the input events.")]
    public bool ReceivesEvents { get; set; }
    Property Value
    System.Boolean

    RenderCamera

    Gets or sets the camera used to place the GUI when render mode is set to CameraSpace or WorldSpaceFaceCamera.

    Declaration
    [EditorOrder(50)]
    [EditorDisplay("Canvas", null)]
    [VisibleIf("Editor_UseRenderCamera", false)]
    [Tooltip("Camera used to place the GUI when RenderMode is set to CameraSpace or WorldSpaceFaceCamera.")]
    public Camera RenderCamera { get; set; }
    Property Value
    Camera

    RenderLocation

    Gets or sets the canvas rendering location within rendering pipeline. Used only in CameraSpace or WorldSpace or WorldSpaceFaceCamera.

    Declaration
    [EditorOrder(13)]
    [EditorDisplay("Canvas", null)]
    [VisibleIf("Editor_Is3D", false)]
    [Tooltip("Canvas rendering location within the rendering pipeline. Change this if you want GUI to affect the lighting or post processing effects like bloom.")]
    public PostProcessEffectLocation RenderLocation { get; set; }
    Property Value
    PostProcessEffectLocation

    RenderMode

    Gets or sets the canvas rendering mode.

    Declaration
    [EditorOrder(10)]
    [EditorDisplay("Canvas", null)]
    [Tooltip("Canvas rendering mode.")]
    public CanvasRenderMode RenderMode { get; set; }
    Property Value
    CanvasRenderMode

    Size

    Gets or sets the size of the canvas. Used only in WorldSpace or WorldSpaceFaceCamera.

    Declaration
    [EditorOrder(20)]
    [EditorDisplay("Canvas", null)]
    [VisibleIf("Editor_IsWorldSpace", false)]
    [Tooltip("Canvas size.")]
    public Float2 Size { get; set; }
    Property Value
    Float2

    Methods

    DefaultCalculateRay(ref Float2, out Ray)

    The default implementation of the UICanvas.CalculateRayDelegate that uses the MainCamera to evaluate the 3D ray.

    Declaration
    public static void DefaultCalculateRay(ref Float2 location, out Ray ray)
    Parameters
    Float2 location

    The location in screen-space.

    Ray ray

    The output ray in world-space.

    Finalize()

    Finalizes an instance of the UICanvas class.

    Declaration
    protected override void Finalize()
    Overrides
    Object.Finalize()

    GetWorldMatrix(out Matrix)

    Gets the world matrix used to transform the GUI from the local space to the world space. Handles canvas rendering mode

    Declaration
    public void GetWorldMatrix(out Matrix world)
    Parameters
    Matrix world

    The world.

    GetWorldMatrix(Vector3, out Matrix)

    Gets the world matrix used to transform the GUI from the local space to the world space. Handles canvas rendering mode

    Declaration
    public void GetWorldMatrix(Vector3 viewOrigin, out Matrix world)
    Parameters
    Vector3 viewOrigin

    The view origin (when using relative-to-camera rendering).

    Matrix world

    The world.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat