MCPcopy Create free account
hub / github.com/defold/defold / GetDisplayScale

Function GetDisplayScale

engine/gamesys/src/gamesys/scripts/script_window.cpp:385–393  ·  view source on GitHub ↗

get the display scale * * This returns the content scale of the current display. * * @name window.get_display_scale * @return scale [type:number] The display scale */

Source from the content-addressed store, hash-verified

383 * @return scale [type:number] The display scale
384 */
385static int GetDisplayScale(lua_State* L)
386{
387 DM_LUA_STACK_CHECK(L, 1);
388
389 float scale = dmPlatform::GetDisplayScaleFactor(g_Window.m_Window);
390 lua_pushnumber(L, scale);
391
392 return 1;
393}
394
395/*# set the title of the window
396 *

Callers

nothing calls this directly

Calls 2

lua_pushnumberFunction · 0.85
GetDisplayScaleFactorFunction · 0.50

Tested by

no test coverage detected