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
or Self::layout_no_wrap
.
Returns where the text ended up.
Will wrap text at the given width and line break at \n
.
Paint the results with Self::galley
.
Will line break at \n
.
Paint the results with Self::galley
.
Paint text that has already been layed out in a Galley
.
You can create the Galley
with Self::layout
.
If you want to change the color of the text, use Self::galley_with_color
.
Paint text that has already been layed out in a Galley
.
You can create the Galley
with Self::layout
.
The text color in the Galley
will be replaced with the given color.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Painter
impl !UnwindSafe for Painter
Blanket Implementations
Mutably borrows from an owned value. Read more