A viewport is a 'window' through which the player sees the current room.


Properties


Camera

Camera Camera

Gets/sets the camera to be displayed in this viewport.


Height

int Height

Gets/sets the viewport's height in screen coordinates.


Visible

bool Visible

Gets/sets whether the viewport is enabled and drawn on screen.


Width

int Width

Gets/sets the viewport's width in screen coordinates.


X

int X

Gets/sets the X position on the screen where this viewport is located.


Y

int Y

Gets/sets the Y position on the screen where this viewport is located.


ZOrder

int ZOrder

Gets/sets the viewport's z-order relative to other viewports.


Methods


Create

static Viewport Create()

Creates a new viewport.


Delete

void Delete()

Removes an existing viewport.


GetAtScreenXY

static Viewport GetAtScreenXY(int x, int y)

Finds if there's any viewport at the specified screen coordinates and returns the topmost one.


RoomToScreenPoint

Point RoomToScreenPoint(int roomx, int roomy, bool clipViewport)

Returns the point on screen corresponding to the given room coordinates if seen through this viewport.


ScreenToRoomPoint

Point ScreenToRoomPoint(int scrx, int scry, bool clipViewport)

Returns the point in room corresponding to the given screen coordinates if seen through this viewport.


SetPosition

void SetPosition(int x, int y, int width, int height)

Changes viewport's position on the screen.