Add Safe Area example
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- lua
- 领域
- mobile-dev
调研方向
未指定文件或测试。首先查看现有示例以及 issue 中描述的 Safe Area API,包括 gui.safe_area_mode、gui.gui.set_safe_area_mode() 和 window.get_safe_area()。完成的标准是提供一个可运行的示例,演示在 Android 和 iOS 上实现考虑 Safe Area 的布局。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Lua
- 星标
- 130
- 派生
- 36
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 9
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
defold/examples 的其他 Issue
-
example
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
Dissolve effect未关闭example
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
bug-crash
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
AnkioTomas/moon#154 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
silverbulletmd/silverbullet#2254 ·
维护者通常 1 天内回复
-
bug discord triage
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
severity: medium
难度 2/5 1-3 小时 新手友好度 68/100
luainkernel/lunatik#2699 ·
维护者通常 1 天内回复