Enum egui::Shape[][src]

#[must_use = "Add a Shape to a Painter"]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: Galley,
        text_style: TextStyle,
        color: Color32,
        fake_italics: bool,
    },
    Mesh(Mesh),
}

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.

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: Color32stroke: 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: Galley

The layed out text

text_style: TextStylecolor: Color32fake_italics: bool

If true, tilt the letters for an ugly italics effect

Mesh(Mesh)

Implementations

impl Shape[src]

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

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

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

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

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

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

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

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

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

impl Shape[src]

pub fn mesh(mesh: Mesh) -> Shape[src]

pub fn triangles(mesh: Mesh) -> Shape[src]

👎 Deprecated:

Renamed mesh

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 Shape[src]

impl Debug for Shape[src]

Auto Trait Implementations

impl RefUnwindSafe for Shape

impl Send for Shape

impl Sync for Shape

impl Unpin for Shape

impl UnwindSafe for Shape

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.