Enum egui::Shape[][src]

pub enum Shape {
    Noop,
    Vec(Vec<Shape, Global>),
    Circle {
        center: Pos2,
        radius: f32,
        fill: Color32,
        stroke: Stroke,
    },
    LineSegment {
        points: [Pos2; 2],
        stroke: Stroke,
    },
    Path {
        points: Vec<Pos2, Global>,
        closed: bool,
        fill: Color32,
        stroke: Stroke,
    },
    Rect {
        rect: Rect,
        corner_radius: f32,
        fill: Color32,
        stroke: Stroke,
    },
    Text {
        pos: Pos2,
        galley: Arc<Galley>,
        color: Color32,
        fake_italics: bool,
    },
    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.

Vec(Vec<Shape, Global>)

Tuple Fields

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

Circle

Fields

center: Pos2
radius: f32
fill: Color32
stroke: Stroke

LineSegment

Fields

points: [Pos2; 2]
stroke: Stroke

Path

Fields

points: Vec<Pos2, Global>
closed: bool

If true, connect the first and last of the points together. This is required if fill != TRANSPARENT.

fill: Color32

Fill is only supported for convex polygons.

stroke: Stroke

Rect

Fields

rect: Rect
corner_radius: f32

How rounded the corners are. Use 0.0 for no rounding.

fill: Color32
stroke: Stroke

Text

Fields

pos: Pos2

Top left corner of the first character..

galley: Arc<Galley>

The layed out text.

color: Color32

Text color (foreground).

fake_italics: bool

If true, tilt the letters for a hacky italics effect.

Mesh(Mesh)

Tuple Fields

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 connect two points.

A line that closes back to the start point again.

A convex polygon with a fill and optional stroke.

👎 Deprecated:

Renamed convex_polygon

👎 Deprecated:

Renamed mesh

Translate location by this much, 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

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)

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.