[][src]Enum egui::paint::command::PaintCmd

pub enum PaintCmd {
    Noop,
    Circle {
        center: Pos2,
        radius: f32,
        fill: Srgba,
        stroke: Stroke,
    },
    LineSegment {
        points: [Pos2; 2],
        stroke: Stroke,
    },
    Path {
        points: Vec<Pos2>,
        closed: bool,
        fill: Srgba,
        stroke: Stroke,
    },
    Rect {
        rect: Rect,
        corner_radius: f32,
        fill: Srgba,
        stroke: Stroke,
    },
    Text {
        pos: Pos2,
        galley: Galley,
        text_style: TextStyle,
        color: Srgba,
    },
    Triangles(Triangles),
}

Variants

Noop

Paint nothing. This can be useful as a placeholder.

Circle

Fields of Circle

center: Pos2radius: f32fill: Srgbastroke: Stroke
LineSegment

Fields of LineSegment

points: [Pos2; 2]stroke: Stroke
Path

Fields of Path

points: Vec<Pos2>closed: bool

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

fill: Srgbastroke: Stroke
Rect

Fields of Rect

rect: Rectcorner_radius: f32fill: Srgbastroke: Stroke
Text

Fields of Text

pos: Pos2

Top left corner of the first character.

galley: Galley

The layed out text

text_style: TextStylecolor: Srgba
Triangles(Triangles)

Implementations

impl PaintCmd[src]

pub fn line_segment(points: [Pos2; 2], stroke: impl Into<Stroke>) -> Self[src]

pub fn line(points: Vec<Pos2>, stroke: impl Into<Stroke>) -> Self[src]

pub fn closed_line(points: Vec<Pos2>, stroke: impl Into<Stroke>) -> Self[src]

pub fn polygon(
    points: Vec<Pos2>,
    fill: impl Into<Srgba>,
    stroke: impl Into<Stroke>
) -> Self
[src]

pub fn circle_filled(
    center: Pos2,
    radius: f32,
    fill_color: impl Into<Srgba>
) -> Self
[src]

pub fn circle_stroke(
    center: Pos2,
    radius: f32,
    stroke: impl Into<Stroke>
) -> Self
[src]

pub fn rect_filled(
    rect: Rect,
    corner_radius: f32,
    fill_color: impl Into<Srgba>
) -> Self
[src]

pub fn rect_stroke(
    rect: Rect,
    corner_radius: f32,
    stroke: impl Into<Stroke>
) -> Self
[src]

pub fn text(
    fonts: &Fonts,
    pos: Pos2,
    anchor: (Align, Align),
    text: impl Into<String>,
    text_style: TextStyle,
    color: Srgba
) -> Self
[src]

impl PaintCmd[src]

pub fn triangles(triangles: Triangles) -> Self[src]

pub fn texture_id(&self) -> TextureId[src]

pub fn translate(&mut self, delta: Vec2)[src]

Translate location by this much, in-place

Trait Implementations

impl Clone for PaintCmd[src]

impl Debug for PaintCmd[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.