defold (official)
defold/extension-safearea/safearea
Defold native extension that will change the view/render of a game to fit into the safe area on iPhones and Android(API 28+) with notch.
- GitHub: defold/extension-safearea — pinned to
1.5.2(released while Defold 1.11.2 was current)- Pick a release from defold/extension-safearea releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as safearea from "safearea"
- Pick a release from defold/extension-safearea releases and add its Source code (zip) URL (or a packaged
Functions
safearea.set_background_color(color: vector4)
set background color in runtime
Parameters
color:vector4— Color will be used as background color.
safearea.get_insets(): table
returns table with top, left, right, bottom values of insets and status
Returns
insets:table
safearea.get_corners_radius(): table
returns a table with top_left, top_right, bottom_left, and bottom_right values of rounded corners and status.
Returns
corners:table