Enum dotrix_egui::Shape[]

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.

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

Fields of Circle

center: Pos2radius: f32fill: Color32stroke: Stroke
LineSegment

Fields of LineSegment

points: [Pos2; 2]stroke: Stroke
Path

Fields of Path

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 of Rect

rect: Rectcorner_radius: f32

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

fill: Color32stroke: Stroke
Text

Fields of Text

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 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.

👎 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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Constructs wrapped service

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

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.