/// Sets the positon of the camera and prevents leaving Level
/// The Camera can't leave World Coordinates.
Sets the positon of the camera and prevents leaving Level
The Camera can't leave World Coordinates.
Sets the positon of the camera and prevents leaving Level The Camera can ' t leave World Coordinates .
fn cam_border(&mut self, range: Range) {
        self.x = if self.x < range.x_min {
            range.x_min
        } else if self.x >= range.x_max {
            range.x_max - 1
        } else {
            self.x
        };
        self.y = if self.y < range.y_min {
            range.y_min
        } else if self.y >= range.y_max {
            range.y_max - 1
        } else {
            self.y
        };
    }
fn cam_border ( & mut self , range : Range ) { self . x = if self . x < range . x_min { range . x_min } else if self . x >= range . x_max { range . x_max - 1 } else { self . x } ; self . y = if self . y < range . y_min { range . y_min } else if self . y >= range . y_max { range . y_max - 1 } else { self . y } ; }
Sets the positon of the camera and prevents leaving Level
The Camera can't leave World Coordinates.
Sets the positon of the camera and prevents leaving Level The Camera can ' t leave World Coordinates .
&mut self
range
Range