Add Safe Area example
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- lua
- Domain
- mobile-dev
Research direction
No file or test is named. Start by reviewing the existing examples and the Safe Area APIs described in the issue, including gui.safe_area_mode, gui.gui.set_safe_area_mode(), and window.get_safe_area(). Done means a runnable example demonstrates safe-area-aware layout on Android and iOS.
Written by the indexing model from the issue text.
Description
Describe the example you'd like
Safe Area is built-in since Defold 1.12.1
Safe Area support for Android and iOS phones is now available in the engine out of the box.
You can control how the GUI respects the safe area using gui.safe_area_mode = none|long|short|both in game.project, with the option to override this per GUI scene at runtime via gui.gui.set_safe_area_mode(gui.SAFE_AREA_*).
This allows UI elements to stay within safe zones on devices with notches, while still using the full screen when no cutout is present (On platforms without cutouts, the inset values are returned as 0).
The new window.get_safe_area() API provides the current safe area rectangle along with inset values, making it possible to use this data in custom layout and positioning logic.
Additional context (optional)
Here you can specify references (screenshots, links) of what you would like to see in the example.
- Dominant language
- Lua
- Stars
- 130
- Forks
- 36
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from defold/examples
-
example
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
Dissolve effectOpenexample
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
Similar issues
-
bug-crash
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AnkioTomas/moon#154 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
silverbulletmd/silverbullet#2254 ·
Maintainers usually reply within 1 day
-
bug discord triage
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
severity: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
luainkernel/lunatik#2699 ·
Maintainers usually reply within 1 day