DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetFramerateText()

void DebugMonitor::SetFramerateText ( TextWidget widget,
float value )
inlineprotected

Sets the provided text widget to display framerate value. Formats and colors the widget according to the value.

См. определение в файле DebugMonitor.c строка 92

93 {
94 // Ideally we would poll the refresh rate and base the values as
95 // percentage thereof, but there is no such API in scripts.
96
97 #ifdef PLATFORM_CONSOLE
98 // default [30, inf] ; orange [20, 29] ; red [0, 19]
99 if (value > 29)
100 widget.SetColor(m_FPSTextDefaultColor);
101 else if (value > 19)
102 widget.SetColor(0xFFFF8000); // COLOR_ORANGE
103 else
104 widget.SetColor(COLOR_RED);
105 #else
106 // default [60, inf] ; yellow [40, 59] ; orange [30, 39] ; red [0, 29]
107 if (value > 59)
108 widget.SetColor(m_FPSTextDefaultColor);
109 else if (value > 39)
110 widget.SetColor(COLOR_YELLOW);
111 else if (value > 29)
112 widget.SetColor(0xFFFF8000); // COLOR_ORANGE
113 else
114 widget.SetColor(COLOR_RED);
115 #endif
116
117 widget.SetTextFormat("%1", Math.Round(value));
118 }
int m_FPSTextDefaultColor
Определения DebugMonitor.c:21
const int COLOR_RED
Определения constants.c:64
const int COLOR_YELLOW
Определения constants.c:67

Перекрестные ссылки COLOR_RED, COLOR_YELLOW, m_FPSTextDefaultColor и Math::Round().

Используется в SetFramerate().