Vector2 Center { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Center property of the GraphicsItem class represents the central point of the graphical item in local coordinates. It is a Vector2 type, which means it contains two float values representing the X and Y coordinates of the center.

Usage

Use the Center property to get or set the central point of a GraphicsItem. This can be useful for positioning the item within a scene or for aligning it with other items.

Example

// Example of accessing the Center property
GraphicsItem item = new GraphicsItem();
Vector2 center = item.Center;

// Setting a new center position
item.Center = new Vector2(100.0f, 150.0f);