float Rotation { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Rotation property of the GraphicsItem class represents the rotation angle of the graphics item in degrees. This property allows you to get or set the rotation of the item, which affects how the item is displayed within the scene. The rotation is applied around the center of the item.

Usage

To use the Rotation property, simply access it through an instance of the GraphicsItem class. You can read the current rotation or assign a new rotation value to change how the item is oriented.

Example

// Example of setting the rotation of a GraphicsItem
GraphicsItem item = new GraphicsItem();

// Set the rotation to 45 degrees
item.Rotation = 45.0f;

// Get the current rotation
float currentRotation = item.Rotation;

// Output the current rotation
// Note: Avoid using Console.WriteLine in s&box
// Instead, use in-game debugging tools or UI elements to display this information