indiesoftby
indiesoftby/defold-page-visibility/page_visibility
The Page Visibility API for Defold
- GitHub: indiesoftby/defold-page-visibility — pinned to
1.0.0(released while Defold 1.9.8 was current)- Pick a release from indiesoftby/defold-page-visibility 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 page_visibility from "page_visibility"
- Pick a release from indiesoftby/defold-page-visibility releases and add its Source code (zip) URL (or a packaged
- Asset Portal: defold-page-visibility
Functions
page_visibility.set_listener(callback?: function)
Sets or removes the listener for the page visibility change event.
Parameters
callback?:function— The callback to be called when the page visibility changes.
page_visibility.state(): number
Returns the current state of the page visibility.
Returns
state:number— The current state of the page visibility.
Constants
page_visibility.STATE_VISIBLE
The page is visible.
page_visibility.STATE_HIDDEN
The page is hidden.