CommentUI CreateNewComment( string text, CommentColor color, Vector2 position, Vector2 size )

book_4_sparkGenerated
code_blocksInput

Description

The CreateNewComment method is used to create a new comment in the node editor graph view. This method allows you to specify the text, color, position, and size of the comment, providing a way to annotate or add notes to specific areas of your graph.

Usage

To use the CreateNewComment method, you need to have an instance of the GraphView class. Call the method with the desired parameters to create a comment at a specific location with a specified size and color.

Example

// Example of creating a new comment in a GraphView
GraphView graphView = new GraphView();

// Define the comment properties
string commentText = "This is a comment";
CommentColor commentColor = CommentColor.Yellow;
Vector2 commentPosition = new Vector2(100, 200);
Vector2 commentSize = new Vector2(300, 150);

// Create the comment
CommentUI comment = graphView.CreateNewComment(commentText, commentColor, commentPosition, commentSize);

// The comment is now added to the graph view with the specified properties.