Skip to Content
defold-typescript libraries
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)
    1. Pick a release from defold/extension-safearea releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as safearea from "safearea"

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

Constants

safearea.STATUS_OK

safearea.STATUS_NOT_AVAILABLE

safearea.STATUS_NOT_READY_YET

On this page