Struct piston_window::Context [−][src]
pub struct Context {
pub viewport: Option<Viewport>,
pub view: [[f64; 3]; 2],
pub transform: [[f64; 3]; 2],
pub draw_state: DrawState,
}
Expand description
Drawing 2d context.
Fields
viewport: Option<Viewport>
Viewport information.
view: [[f64; 3]; 2]
View transformation.
transform: [[f64; 3]; 2]
Current transformation.
draw_state: DrawState
Current draw state settings.
Implementations
Creates a new context with absolute transform in point coordinates.
This function assumes the default coordinate system being centered with x axis pointing to the right and y axis pointing up.
Returns a drawing context with origin in the upper left corner and x axis pointing to the right and y axis pointing down.
Creates a new drawing context in absolute coordinates.
This function assumes the default coordinate system being centered with x axis pointing to the right and y axis pointing up.
Returns a drawing context with origin in the upper left corner and x axis pointing to the right and y axis pointing down.
Moves the current transform to the view coordinate system.
This is usually [0.0, 0.0] in the upper left corner with the x axis pointing to the right and the y axis pointing down.
Moves the current transform to the default coordinate system.
This is usually [0.0, 0.0] in the center with the x axis pointing to the right and the y axis pointing up.
Stores the current transform as new view.
Computes the current view size.
Trait Implementations
Appends transform to the current one.
Prepends transform to the current one.
Orients x axis to look at point locally. Read more
Translate position in local coordinates.
Orients x axis to look at point locally.
Auto Trait Implementations
impl RefUnwindSafe for Context
impl UnwindSafe for Context
Blanket Implementations
Mutably borrows from an owned value. Read more