Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 929 Bytes

lifecycle.md

File metadata and controls

15 lines (8 loc) · 929 Bytes

Iris homepage | Documentation table of contents

Iris Life Cycle

There are four methods almost all screens will implement:

  • create() is where you initialize your screen. Most importantly, here you will usually call iris.tmpl() with a template resource defining your UI, and using self.get() to retrieve the components in that UI that you need to interact with programmatically.

  • awake() is where you can add event listeners, execute intervals or initialize heavyweight tasks as play sound or video.

  • sleep() is where you deal with the user leaving your screen. Most importantly, remove event listeners or stop heavyweight tasks.

  • destroy() is where you will perform operations after screen dying.

Iris Life Cycle