Skip to content
Morgan Willcock edited this page Aug 11, 2019 · 20 revisions

Viewport functions and properties

Create

static Viewport *Create();

Creates a new Viewport.

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.Delete

Delete

void Delete();

Removes an existing viewport; note that primary viewport will never be removed.

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.Create

GetAtScreenXY

static Viewport *GetAtScreenXY(int x, int y);

Returns the viewport at the specified screen location.

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.Delete, Viewport.Create

SetPosition

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

Changes viewport's position on the screen.

Compatibility: Supported by AGS 3.5.0 and later versions.

ScreenToRoomPoint

Point *ScreenToRoomPoint(int scrx, int scry, bool clipViewport = true);

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

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.RoomToScreenPoint

RoomToScreenPoint

Point *RoomToScreenPoint(int roomx, int roomy, bool clipViewport = true);

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

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.ScreenToRoomPoint

ZOrder

attribute int ZOrder;

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

Compatibility: Supported by AGS 3.5.0 and later versions.

Visible

attribute bool Visible;

Gets/sets whether the viewport is drawn on screen.

Compatibility: Supported by AGS 3.5.0 and later versions.

Camera

attribute Camera *Camera;

Gets/sets the room camera displayed in this viewport.

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Camera.Create

Width

attribute int Viewport.Width;

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

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.Height

Height

attribute int Viewport.Height;

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

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.Width

X

static int Viewport.X;

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

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.Y

Y

static int Viewport.Y;

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

Compatibility: Supported by AGS 3.5.0 and later versions.

See Also: Viewport.X

Getting Started in AGS

Editor

Engine

Scripting

Legal Notice

Getting in touch

Misc

Hidden

Clone this wiki locally