Struct mold2d::viewport::Viewport [] [src]

pub struct Viewport {
    pub x: i32,
    pub y: i32,
    pub window_dimensions: (i32, i32),
    pub map_dimensions: (i32, i32),
}

Constrains coordinates from an open world into the current window view This allows for scrolling for levels larger than the current screen

Fields

The x value of the center coordinate of the viewport

The y value of the center coordinate of the viewport

Width and height of the window

Width and height of the map

Methods

impl Viewport
[src]

Returns true if the point is inside the viewport, false otherwise

Returns the point in the game relative to the viewpoint

Returns a rectangle in viewport coordinates or None if not in viewport

Trait Implementations

impl Clone for Viewport
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more