Class Control_GD_CB_Extension
- Namespace
- Godot
- Assembly
- com.cobilas.godot.utility.dll
Provides extension methods for the Godot.Control class of Godot, allowing operations with 2D rectangles (Rect2D) more conveniently.
public static class Control_GD_CB_Extension
- Inheritance
-
Control_GD_CB_Extension
- Inherited Members
Remarks
This class facilitates conversion between the rectangle properties of Godot.Control and the custom Rect2D type, for both local and global coordinates.
Methods
GetGlobalRect2D(Control?)
Gets a Rect2D representing the global rectangle of the Godot.Control.
public static Rect2D GetGlobalRect2D(this Control? ctl)
Parameters
ctlControlGodot.Control target (can be null)
Returns
- Rect2D
A Rect2D containing the global position, size, rotation, scale, and pivot of the Godot.Control
Exceptions
- ArgumentNullException
Thrown when Godot.Control is null
GetRect2D(Control?)
Gets a Rect2D representing the local rectangle of the Godot.Control.
public static Rect2D GetRect2D(this Control? ctl)
Parameters
ctlControlGodot.Control target (can be null)
Returns
Exceptions
- ArgumentNullException
Thrown when Godot.Control is null
SetGlobalRect2D(Control?, Rect2D)
Sets the properties of the Godot.Control based on a Rect2D, using global coordinates.
public static void SetGlobalRect2D(this Control? ctl, Rect2D rect)
Parameters
ctlControlGodot.Control target (can be null)
rectRect2DRect2D containing the global properties to be applied
Exceptions
- ArgumentNullException
Thrown when Godot.Control is null
SetRect2D(Control?, Rect2D)
Sets the properties of the Godot.Control based on a Rect2D.
public static void SetRect2D(this Control? ctl, Rect2D rect)
Parameters
ctlControlGodot.Control target (can be null)
rectRect2DRect2D contendo as propriedades a serem aplicadas
Exceptions
- ArgumentNullException
Thrown when Godot.Control is null