AMFP Enhanced
C++ reference: the code this unofficial fork added
Loading...
Searching...
No Matches
LuxMenuScale.h File Reference

menu size on high-resolution screens. More...

Go to the source code of this file.

Functions

float LuxMenuScale (float afScreenHeight, bool abFix)
 Screen pixels per menu unit (1 = stock).
void LuxMenuVirtualSize (float afScreenW, float afScreenH, bool abFix, float &afOutW, float &afOutH)
 The menu's virtual canvas for a screen size.

Variables

static const float kLuxMenuReferenceHeight = 768.0f

Detailed Description

menu size on high-resolution screens.

The main and pause menu windows (Options, Load game, Profiles, pop-ups) are authored in screen pixels for the 1024x768-era screens the engine targeted, so they shrank as screens grew: a third of a 1080p screen, a quarter of a Retina panel. The menu GUI set gets a virtual canvas of screen / k, k = height / 768 (never below 1): windows keep their 768p proportions at any resolution, items placed by relative size stay put. Main config [Graphics] FixMenuScale="false" restores the stock pixel sizes. Pure, unit tested in tests/cpp/test_menu_scale.cpp.

Definition in file LuxMenuScale.h.

Function Documentation

◆ LuxMenuScale()

float LuxMenuScale ( float afScreenHeight,
bool abFix )
inline

Screen pixels per menu unit (1 = stock).

Definition at line 16 of file LuxMenuScale.h.

◆ LuxMenuVirtualSize()

void LuxMenuVirtualSize ( float afScreenW,
float afScreenH,
bool abFix,
float & afOutW,
float & afOutH )
inline

The menu's virtual canvas for a screen size.

Definition at line 23 of file LuxMenuScale.h.

Variable Documentation

◆ kLuxMenuReferenceHeight

const float kLuxMenuReferenceHeight = 768.0f
static

Definition at line 13 of file LuxMenuScale.h.