mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +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:
@@ -24,6 +24,7 @@
|
||||
// LOVE
|
||||
#include "common/Module.h"
|
||||
#include "common/StringMap.h"
|
||||
#include "common/math.h"
|
||||
#include "image/ImageData.h"
|
||||
|
||||
// C++
|
||||
@@ -151,6 +152,8 @@ public:
|
||||
virtual void setPosition(int x, int y, int displayindex) = 0;
|
||||
virtual void getPosition(int &x, int &y, int &displayindex) = 0;
|
||||
|
||||
virtual Rect getSafeArea() const = 0;
|
||||
|
||||
virtual bool isOpen() const = 0;
|
||||
|
||||
virtual void setWindowTitle(const std::string &title) = 0;
|
||||
|
||||
Reference in New Issue
Block a user