Class Sprite_CB_GB_Extension
- Namespace
- Godot
- Assembly
- com.cobilas.godot.utility.dll
Provides extension methods for Godot's Sprite class, allowing more convenient operations with 2D rectangles (Rect2D).
public static class Sprite_CB_GB_Extension
- Inheritance
-
Sprite_CB_GB_Extension
- Inherited Members
Remarks
This class facilitates conversion between Godot.Sprite properties and the custom Rect2D type, for both local and global coordinates.
Methods
GetGlobalRect2D(Sprite?)
Gets a Rect2D representing the global rectangle of the Godot.Control.
public static Rect2D GetGlobalRect2D(this Sprite? ctl)
Parameters
ctlSpriteGodot.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(Sprite?)
Gets a Rect2D representing the local rectangle of the Godot.Control.
public static Rect2D GetRect2D(this Sprite? ctl)
Parameters
ctlSpriteGodot.Control target (can be null)
Returns
Exceptions
- ArgumentNullException
Thrown when Godot.Control is null
SetGlobalRect2D(Sprite?, Rect2D)
Sets the properties of the Godot.Control based on a Rect2D, using global coordinates.
public static void SetGlobalRect2D(this Sprite? ctl, Rect2D rect)
Parameters
ctlSpriteGodot.Control target (can be null)
rectRect2DRect2D containing the global properties to be applied
Exceptions
- ArgumentNullException
Thrown when Godot.Control is null
SetRect2D(Sprite?, Rect2D)
Sets the properties of the Godot.Control based on a Rect2D.
public static void SetRect2D(this Sprite? ctl, Rect2D rect)
Parameters
ctlSpriteGodot.Control target (can be null)
rectRect2DRect2D contendo as propriedades a serem aplicadas
Exceptions
- ArgumentNullException
Thrown when Godot.Control is null