Class GeometryChangedEvent
This event is sent after layout calculations, when the position or the dimension of an element changes.
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public class GeometryChangedEvent : EventBase<GeometryChangedEvent>
Remarks
This event does not trickle down or bubble up. It cannot be cancelled.
Constructors
GeometryChangedEvent()
Constructor.
Declaration
public GeometryChangedEvent()
Properties
newRect
Gets the elements's new dimensions.
Declaration
public Rect newRect { get; }
Property Value
Type | Description |
---|---|
Rect |
oldRect
Gets the element's old dimensions.
Declaration
public Rect oldRect { get; }
Property Value
Type | Description |
---|---|
Rect |
Methods
GetPooled(Rect, Rect)
Gets an event from the event pool, and initializes it with the specified values. Use this method instead of instancing new events. Use Dispose() to release events back to the event pool.
Declaration
public static GeometryChangedEvent GetPooled(Rect oldRect, Rect newRect)
Parameters
Type | Name | Description |
---|---|---|
Rect | oldRect | The old dimensions of the element. |
Rect | newRect | The new dimensions of the element. |
Returns
Type | Description |
---|---|
GeometryChangedEvent | An initialized event. |
Init()
Resets the event values to their initial values.
Declaration
protected override void Init()
Overrides
UnityEngine.UIElements.EventBase<UnityEngine.UIElements.GeometryChangedEvent>.Init()