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

Function SetSceneSafeAreaAdjust

engine/gui/src/gui.cpp:316–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314 }
315
316 static void SetSceneSafeAreaAdjust(Scene* scene, bool enabled, uint32_t width, uint32_t height, float offset_x, float offset_y)
317 {
318 scene->m_UseSafeAreaAdjust = enabled;
319 if (enabled)
320 {
321 scene->m_AdjustWidth = width;
322 scene->m_AdjustHeight = height;
323 scene->m_AdjustOffsetX = offset_x;
324 scene->m_AdjustOffsetY = offset_y;
325 }
326 else
327 {
328 scene->m_AdjustWidth = scene->m_Context->m_PhysicalWidth;
329 scene->m_AdjustHeight = scene->m_Context->m_PhysicalHeight;
330 scene->m_AdjustOffsetX = 0.0f;
331 scene->m_AdjustOffsetY = 0.0f;
332 }
333 scene->m_ResChanged = 1;
334 }
335
336 static void ComputeSafeAreaAdjust(SafeAreaMode mode, uint32_t window_width, uint32_t window_height,
337 int32_t inset_left, int32_t inset_top, int32_t inset_right, int32_t inset_bottom,

Callers 4

SetPhysicalResolutionFunction · 0.85
SetSafeAreaAdjustFunction · 0.85
UpdateSafeAreaAdjustFunction · 0.85
SetSceneSafeAreaModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected