Struct tetra::graphics::scaling::ScreenScaler [−][src]
pub struct ScreenScaler { /* fields omitted */ }
Expand description
Implementations
pub fn new(
ctx: &mut Context,
inner_width: i32,
inner_height: i32,
outer_width: i32,
outer_height: i32,
mode: ScalingMode
) -> Result<ScreenScaler>
pub fn new(
ctx: &mut Context,
inner_width: i32,
inner_height: i32,
outer_width: i32,
outer_height: i32,
mode: ScalingMode
) -> Result<ScreenScaler>
Returns a new ScreenScaler
, with the specified inner and outer width and height.
The mode will determine how the image is scaled to fit the screen.
pub fn with_window_size(
ctx: &mut Context,
inner_width: i32,
inner_height: i32,
mode: ScalingMode
) -> Result<ScreenScaler>
pub fn with_window_size(
ctx: &mut Context,
inner_width: i32,
inner_height: i32,
mode: ScalingMode
) -> Result<ScreenScaler>
Returns a new ScreenScaler
, with the specified inner width and height, and the outer
size set to the current dimensions of the window.
Updates the scaler’s outer size (i.e. the size of the box that the screen will be scaled to fit within).
Returns the current scaling mode.
Sets the scaling mode that should be used.
Converts a point from window co-ordinates to scaled screen co-ordinates.
Converts a point from scaled screen co-ordinates to window co-ordinates.
Returns the position of the mouse in scaled screen co-ordinates.
This is a shortcut for calling .project(input::get_mouse_position(ctx))
.
Returns the X co-ordinate of the mouse in scaled screen co-ordinates.
This is a shortcut for calling project(input::get_mouse_position(ctx)).x
.
Returns the Y co-ordinate of the mouse in scaled screen co-ordinates.
This is a shortcut for calling project(input::get_mouse_position(ctx)).y
.