Struct egui::Painter [−][src]
pub struct Painter { /* fields omitted */ }
Expand description
Helper to paint shapes and text to a specific region on a specific layer.
All coordinates are screen coordinates in the unit points (one point can consist of many physical pixels).
Implementations
redirect
Create a painter for a sub-region of this Painter
.
The clip-rect of the returned Painter
will be the intersection
of the given rectangle and the clip_rect()
of this Painter
.
Everything painted in this Painter
will be clipped against this.
This means nothing outside of this rectangle will be visible on screen.
Everything painted in this Painter
will be clipped against this.
This means nothing outside of this rectangle will be visible on screen.
Useful for pixel-perfect rendering.
Useful for pixel-perfect rendering.
Useful for pixel-perfect rendering.
It is up to the caller to make sure there is room for this. Can be used for free painting. NOTE: all coordinates are screen coordinates!
Add many shapes at once.
Calling this once is generally faster than calling Self::add
multiple times.
Lay out and paint some text.
To center the text at the given position, use anchor: (Center, Center)
.
To find out the size of text before painting it, use
Self::layout_no_wrap
or Self::layout_multiline
.
Returns where the text ended up.
Will line break at \n
.
Paint the results with Self::galley
.
Always returns at least one row.
Will wrap text at the given width and line break at \n
.
Paint the results with Self::galley
.
Always returns at least one row.
Paint text that has already been layed out in a Galley
.
You can create the Galley
with Self::layout_no_wrap
or Self::layout_multiline
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Painter
impl !UnwindSafe for Painter
Blanket Implementations
Mutably borrows from an owned value. Read more