Struct conrod_piston::draw::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
impl Context
[src]
impl Context
[src]pub fn new_viewport(viewport: Viewport) -> Context
[src]
pub fn new_viewport(viewport: Viewport) -> Context
[src]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.
pub fn new_abs(w: f64, h: f64) -> Context
[src]
pub fn new_abs(w: f64, h: f64) -> Context
[src]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.
pub fn view(self) -> Context
[src]
pub fn view(self) -> Context
[src]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.
pub fn reset(self) -> Context
[src]
pub fn reset(self) -> Context
[src]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.
pub fn store_view(self) -> Context
[src]
pub fn store_view(self) -> Context
[src]Stores the current transform as new view.
pub fn get_view_size(&self) -> [f64; 2]
[src]
pub fn get_view_size(&self) -> [f64; 2]
[src]Computes the current view size.
Trait Implementations
impl Transformed for Context
[src]
impl Transformed for Context
[src]pub fn append_transform(self, transform: [[f64; 3]; 2]) -> Context
[src]
pub fn append_transform(self, transform: [[f64; 3]; 2]) -> Context
[src]Appends transform to the current one.
pub fn prepend_transform(self, transform: [[f64; 3]; 2]) -> Context
[src]
pub fn prepend_transform(self, transform: [[f64; 3]; 2]) -> Context
[src]Prepends transform to the current one.
pub fn orient(self, x: f64, y: f64) -> Context
[src]
pub fn orient(self, x: f64, y: f64) -> Context
[src]Orients x axis to look at point locally. Read more
fn trans_pos<P>(self, pos: P) -> Self where
P: Into<[f64; 2]>,
[src]
fn trans_pos<P>(self, pos: P) -> Self where
P: Into<[f64; 2]>,
[src]Translate position in local coordinates.
impl Copy for Context
[src]
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more