Enum egui::Shape[][src]

pub enum Shape {
    Noop,
    Vec(Vec<Shape, Global>),
    Circle(CircleShape),
    LineSegment {
        points: [Pos2; 2],
        stroke: Stroke,
    },
    Path(PathShape),
    Rect(RectShape),
    Text(TextShape),
    Mesh(Mesh),
}
Expand description

A paint primitive such as a circle or a piece of text. Coordinates are all screen space points (not physical pixels).

Variants

Noop

Paint nothing. This can be useful as a placeholder.

Recursively nest more shapes - sometimes a convenience to be able to do. For performance reasons it is better to avoid it.

Tuple Fields of Vec

0: Vec<Shape, Global>
Circle(CircleShape)

Tuple Fields of Circle

0: CircleShape
LineSegment

Fields of LineSegment

points: [Pos2; 2]stroke: Stroke
Path(PathShape)

Tuple Fields of Path

0: PathShape
Rect(RectShape)

Tuple Fields of Rect

0: RectShape
Text(TextShape)

Tuple Fields of Text

0: TextShape
Mesh(Mesh)

Tuple Fields of Mesh

0: Mesh

Implementations

A line between two points. More efficient than calling Self::line.

A line through many points.

Use Self::line_segment instead if your line only connects two points.

A line that closes back to the start point again.

Turn a line into equally spaced dots.

Turn a line into dashes.

A convex polygon with a fill and optional stroke.

Move the shape by this many points, in-place.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.