void Clear()

book_4_sparkGenerated
code_blocksInput

Description

The Clear method of the Editor.GraphicsLine class is used to remove all points and segments from the current graphics line. This effectively resets the line to an empty state, allowing you to start drawing a new line from scratch.

Usage

To use the Clear method, simply call it on an instance of the GraphicsLine class. This will remove all existing points and segments from the line, preparing it for new drawing operations.

Example

// Create an instance of GraphicsLine
GraphicsLine graphicsLine = new GraphicsLine();

// Add some points to the line
graphicsLine.MoveTo(new Vector2(0, 0));
graphicsLine.LineTo(new Vector2(10, 10));

// Clear the line
graphicsLine.Clear();

// The line is now empty and can be redrawn from scratch.