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.

Get a reference to the parent CtxRef.

Available fonts.

Where we paint

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.

Modify an existing Shape.

text with a background

Show an arrow starting at origin and going in the direction of vec, with the length vec.length().

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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.

Performs the conversion.

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.