OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
ViewportSign Struct Reference

Location information about a sign as seen on the viewport. More...

`#include <viewport_type.h>`

Inheritance diagram for ViewportSign:

## Public Member Functions
void | UpdatePosition (int center, int top, StringID str)
| Update the position of the viewport sign.
void | MarkDirty (ZoomLevel maxzoom=ZOOM_LVL_MAX) const
| Mark the sign dirty in all viewports.

## Data Fields
int32 | center
| The center position of the sign.
int32 | top
| The top of the sign.
uint16 | width_normal
| The width when not zoomed out (normal font)
uint16 | width_small
| The width when zoomed out (small font)

## Detailed Description

Location information about a sign as seen on the viewport.

Definition at line 47 of file viewport_type.h.

## Member Function Documentation

void ViewportSign::UpdatePosition | ( | int | center,
|  | int | top,
|  | StringID | str
| ) |  |

Update the position of the viewport sign.

Parameters

  center | the (preferred) center of the viewport sign
  top | the new top of the sign
  str | the string to show in the sign

Definition at line 1313 of file viewport.cpp.

References Align(), center, DRAW_STRING_BUFFER, FS_SMALL, GetStringBoundingBox(), lastof, MarkDirty(), top, VPSM_LEFT, VPSM_RIGHT, width_normal, and width_small.

Referenced by Waypoint::UpdateVirtCoord(), Sign::UpdateVirtCoord(), Town::UpdateVirtCoord(), and Station::UpdateVirtCoord().

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

- src/viewport_type.h
- src/viewport.cpp