Show / Hide Table of Contents

Class GuiElementPosition

Contains convenience functions to position a UI element on its parent element.

Inheritance
System.Object
GuiElementPosition
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Fusee.Engine.Gui
Assembly: Fusee.Engine.Gui.dll
Syntax
public static class GuiElementPosition

Methods

CalcOffsets(AnchorPos, float2, Single, Single, float2)

Calculates the offset between an element and their parent element and therefore its size.

Declaration
public static MinMaxRect CalcOffsets(AnchorPos anchorPos, float2 posOnParent, float parentHeight, float parentWidth, float2 guiElementDim)
Parameters
Type Name Description
AnchorPos anchorPos

The anchor point of the element.

float2 posOnParent

The position on the parent element.

System.Single parentHeight

The height of the parent element.

System.Single parentWidth

The width of the parent element.

float2 guiElementDim

The dimensions of the element along the x and y axis.

Returns
Type Description
MinMaxRect

GetAnchors(AnchorPos)

Sets the anchor position in percent as a MinMaxRect depending on its AnchorPos

Declaration
public static MinMaxRect GetAnchors(AnchorPos anchorPos)
Parameters
Type Name Description
AnchorPos anchorPos

The anchor point of the UI element.

Returns
Type Description
MinMaxRect

The MinMaxRect containing the anchor position in percent.

Generated by DocFX
GitHub Repo
Back to top