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:
Alex Szpakowski
2018-12-26 00:34:14 -04:00
parent 1c853cbcc3
commit d41aca836e
6 changed files with 81 additions and 3 deletions
+3
View File
@@ -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;