OpenTTD Game API
Static Public Member Functions
GSViewport Class Reference

Class that manipulates the user's viewport. More...

Inheritance diagram for GSViewport:

Static Public Member Functions

static void ScrollTo (TileIndex tile)
 Scroll the viewport to the given tile, where the tile will be in the center of the screen. More...
 
static bool ScrollEveryoneTo (TileIndex tile)
 Scroll the viewport of all players to the given tile, where the tile will be in the center of the screen. More...
 
static bool ScrollCompanyClientsTo (GSCompany::CompanyID company, TileIndex tile)
 Scroll the viewports of all players in the company to the given tile, where the tile will be in the center of the screen. More...
 
static bool ScrollClientTo (GSClient::ClientID client, TileIndex tile)
 Scroll the viewport of the client to the given tile, where the tile will be in the center of the screen. More...
 

Detailed Description

Class that manipulates the user's viewport.

Member Function Documentation

◆ ScrollClientTo()

static bool GSViewport::ScrollClientTo ( GSClient::ClientID  client,
TileIndex  tile 
)
static

Scroll the viewport of the client to the given tile, where the tile will be in the center of the screen.

Parameters
clientThe client to scroll the viewport of.
tileThe tile to put in the center of the screen.
Precondition
GSGame::IsMultiplayer()
GSObject::GetCompany() == OWNER_DEITY
GSMap::IsValidTile(tile)
ResolveClientID(client) != CLIENT_INVALID

◆ ScrollCompanyClientsTo()

static bool GSViewport::ScrollCompanyClientsTo ( GSCompany::CompanyID  company,
TileIndex  tile 
)
static

Scroll the viewports of all players in the company to the given tile, where the tile will be in the center of the screen.

Parameters
companyThe company which players to scroll the viewport of.
tileThe tile to put in the center of the screen.
Precondition
GSObject::GetCompany() == OWNER_DEITY
GSMap::IsValidTile(tile)
ResolveCompanyID(company) != COMPANY_INVALID

◆ ScrollEveryoneTo()

static bool GSViewport::ScrollEveryoneTo ( TileIndex  tile)
static

Scroll the viewport of all players to the given tile, where the tile will be in the center of the screen.

Parameters
tileThe tile to put in the center of the screen.
Precondition
GSObject::GetCompany() == OWNER_DEITY
GSMap::IsValidTile(tile)

◆ ScrollTo()

static void GSViewport::ScrollTo ( TileIndex  tile)
static

Scroll the viewport to the given tile, where the tile will be in the center of the screen.

Parameters
tileThe tile to put in the center of the screen.
Precondition
! GSGame::IsMultiplayer().
GSMap::IsValidTile(tile).