OpenTTD Source  20241108-master-g80f628063a
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.
 
enum  AlignmentV : uint8_t { TOP , MIDDLE , BOTTOM }
 Vertical alignment value.
 

Public Member Functions

Point PositionForViewport (const Viewport *vp)
 Calculate effective position. More...
 

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 = INVALID_VEHICLE
 Vehicle to follow, or INVALID_VEHICLE 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 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
vpViewport 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, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::Get(), INVALID_VEHICLE, position, RemapCoords(), Viewport::virtual_height, Viewport::virtual_width, Vehicle::x_pos, Vehicle::y_pos, and Vehicle::z_pos.


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