mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Add love.window.getSafeArea (resolves issue #1437). Returns a rectangle (x, y, w, h) inside the window which is known to be unobstructed by a system title bar, the iPhone X notch, etc. Useful for making sure UI elements can be seen by the user.
Currently it only has a proper implementation on iOS and will return the window's full size otherwise.
This commit is contained in:
@@ -25,8 +25,12 @@
|
||||
|
||||
#ifdef LOVE_IOS
|
||||
|
||||
#include "common/math.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
struct SDL_Window;
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace ios
|
||||
@@ -74,6 +78,12 @@ void setAudioMixWithOthers(bool mixEnabled);
|
||||
**/
|
||||
bool hasBackgroundMusic();
|
||||
|
||||
/**
|
||||
* Gets the area in the window that is safe for UI to render to (not covered by
|
||||
* the status bar, notch, etc.)
|
||||
**/
|
||||
Rect getSafeArea(SDL_Window *window);
|
||||
|
||||
} // ios
|
||||
} // love
|
||||
|
||||
|
||||
Reference in New Issue
Block a user