Camera¶
- class Camera(*, map: tuple[int, int], screen: tuple[int, int], center: Tile = None, lock_view: bool = True)¶
Bases:
objectTranslates world coordinates to facilitate maps larger than the screen.
- Parameters:
map – Dimensions of the map
screen – Dimensions of the screen
center – Focused tile
lock_view – Whether the camera is kept inside the world
- set_center(x: int, y: int) None¶
- set_center(center: Tile) None
Set the center of the camera.
- Raises:
AttributeError – If the arguments are the wrong type
- property view_slice: tuple[slice, slice]¶
Get a slice that can be used on an NDArray.
- property x_max: int¶
x coordinate of the bottom right tile
- property x_min: int¶
x coordinate of the top-left tile
- property y_max: int¶
y coordinate of the bottom right tile
- property y_min: int¶
y coordinate of the top-left tile