OpenTTD Source 20260704-master-gbf70c61fb8
Alignment Struct Reference

Horizontal and vertical alignment. More...

#include <geometry_type.hpp>

Public Member Functions

constexpr Alignment (AlignmentH h, AlignmentV v)
 Construct an alignment with the specified horizontal and vertical alignment.
constexpr Alignment (AlignmentH h)
 Construct an alignment with the specific horizontal alignment.
AlignmentH ResolveRTL () const
 Resolve horizontal alignment for the current text direction.

Data Fields

AlignmentH h
 Horizontal alignment.
AlignmentV v
 Vertical alignment.

Detailed Description

Horizontal and vertical alignment.

Definition at line 36 of file geometry_type.hpp.

Constructor & Destructor Documentation

◆ Alignment() [1/2]

Alignment::Alignment ( AlignmentH h,
AlignmentV v )
inlineconstexpr

Construct an alignment with the specified horizontal and vertical alignment.

Parameters
hThe horizontal alignment.
vThe vertical alignment.

Definition at line 45 of file geometry_type.hpp.

References h, and v.

Referenced by Alignment().

◆ Alignment() [2/2]

Alignment::Alignment ( AlignmentH h)
inlineconstexpr

Construct an alignment with the specific horizontal alignment.

Parameters
hThe horizontal alignment.

Definition at line 51 of file geometry_type.hpp.

References Alignment(), and h.

Member Function Documentation

◆ ResolveRTL()

AlignmentH Alignment::ResolveRTL ( ) const

Resolve horizontal alignment for the current text direction.

Returns
The resolved horizontal alignment.

Definition at line 22 of file geometry_func.cpp.

References _current_text_dir, End, ForceLeft, ForceRight, h, Start, and TD_RTL.

Referenced by DrawLayoutLine(), GetAlignedPosition(), and IntroGameViewportCommand::PositionForViewport().

Field Documentation

◆ h

AlignmentH Alignment::h

Horizontal alignment.

Definition at line 37 of file geometry_type.hpp.

Referenced by Alignment(), Alignment(), DrawLayoutLine(), SelectGameWindow::ReadIntroGameViewportCommand(), and ResolveRTL().

◆ v


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