OpenTTD Source: IntroGameViewportCommand Struct Reference

OpenTTD Source 15.0-RC2

Public Types | Public Member Functions | Data Fields
IntroGameViewportCommand Struct Reference

A viewport command for the main menu background (intro game). More...

## Public Types
enum | AlignmentH : uint8_t { LEFT , CENTRE , RIGHT }
| Horizontal alignment value. More...
enum | AlignmentV : uint8_t { TOP , MIDDLE , BOTTOM }
| Vertical alignment value. More...

## Public Member Functions
Point | PositionForViewport (const Viewport &vp)
| Calculate effective position.

## Data Fields
int | command_index = 0
| Sequence number of the command (order they are performed in).
Point | position { 0, 0 }
| Calculated world coordinate to position viewport top-left at.
VehicleID | vehicle = VehicleID::Invalid()
| Vehicle to follow, or VehicleID::Invalid() if not following a vehicle.
uint | delay = 0
| Delay until next command.
int | zoom_adjust = 0
| Adjustment to zoom level from base zoom level.
bool | pan_to_next = false
| If true, do a smooth pan from this position to the next.
AlignmentH | align_h = CENTRE
| Horizontal alignment.
AlignmentV | align_v = MIDDLE
| Vertical alignment.

## Detailed Description

A viewport command for the main menu background (intro game).

Definition at line 49 of file intro_gui.cpp.

## Member Enumeration Documentation

## ◆ AlignmentH

enum IntroGameViewportCommand::AlignmentH : uint8_t

Horizontal alignment value.

Definition at line 51 of file intro_gui.cpp.

## ◆ AlignmentV

enum IntroGameViewportCommand::AlignmentV : uint8_t

Vertical alignment value.

Definition at line 57 of file intro_gui.cpp.

## Member Function Documentation

## ◆ PositionForViewport()

Point IntroGameViewportCommand::PositionForViewport | ( | const Viewport & | vp | ) |
| inline

Calculate effective position.

This will update the position field if a vehicle is followed.

Parameters

  vp | Viewport to calculate position for.

Returns
  Calculated position in the viewport.

Definition at line 78 of file intro_gui.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_vehicle_pool >::Get(), position, RemapCoords(), Viewport::virtual_height, Viewport::virtual_width, Coord2D< T >::x, Vehicle::x_pos, Coord2D< T >::y, Vehicle::y_pos, and Vehicle::z_pos.

Referenced by SelectGameWindow::OnRealtimeTick().

## Field Documentation

## ◆ align_h

AlignmentH IntroGameViewportCommand::align_h = CENTRE

Horizontal alignment.

Definition at line 69 of file intro_gui.cpp.

Referenced by SelectGameWindow::ReadIntroGameViewportCommands().

## ◆ align_v

AlignmentV IntroGameViewportCommand::align_v = MIDDLE

Vertical alignment.

Definition at line 70 of file intro_gui.cpp.

Referenced by SelectGameWindow::ReadIntroGameViewportCommands().

## ◆ command_index

int IntroGameViewportCommand::command_index = 0

Sequence number of the command (order they are performed in).

Definition at line 63 of file intro_gui.cpp.

Referenced by SelectGameWindow::ReadIntroGameViewportCommands().

## ◆ delay

uint IntroGameViewportCommand::delay = 0

Delay until next command.

Definition at line 66 of file intro_gui.cpp.

Referenced by SelectGameWindow::OnRealtimeTick(), and SelectGameWindow::ReadIntroGameViewportCommands().

## ◆ pan_to_next

bool IntroGameViewportCommand::pan_to_next = false

If true, do a smooth pan from this position to the next.

Definition at line 68 of file intro_gui.cpp.

Referenced by SelectGameWindow::OnRealtimeTick(), and SelectGameWindow::ReadIntroGameViewportCommands().

## ◆ position

Point IntroGameViewportCommand::position { 0, 0 }

Calculated world coordinate to position viewport top-left at.

Definition at line 64 of file intro_gui.cpp.

Referenced by PositionForViewport(), and SelectGameWindow::ReadIntroGameViewportCommands().

## ◆ vehicle

VehicleID IntroGameViewportCommand::vehicle = VehicleID::Invalid()

Vehicle to follow, or VehicleID::Invalid() if not following a vehicle.

Definition at line 65 of file intro_gui.cpp.

Referenced by SelectGameWindow::OnRealtimeTick(), and SelectGameWindow::ReadIntroGameViewportCommands().

## ◆ zoom_adjust

int IntroGameViewportCommand::zoom_adjust = 0

Adjustment to zoom level from base zoom level.

Definition at line 67 of file intro_gui.cpp.

Referenced by SelectGameWindow::OnRealtimeTick(), and SelectGameWindow::ReadIntroGameViewportCommands().

The documentation for this struct was generated from the following file:

- src/intro_gui.cpp