Shortcuts adds convenience identifiers to access ceramic app, screen, ... Use it by adding import ceramic.Shortcuts.*; in your files.

Static variables

staticread onlyapp:App

Shared app instance

staticread onlyscreen:Screen

Shared screen instance

staticread onlyaudio:Audio

Shared audio instance

staticread onlyinput:Input

Shared input instance

staticread onlysettings:Settings

Shared settings instance

staticread onlylog:Logger

Shared logger instance

staticread onlysystems:Systems

Systems manager

Static methods

staticinlineunobserve():Void

Ensures current autorun won't be affected by the code after this call. reobserve() should be called to restore previous state.

staticinlinereobserve():Void

Resume observing values and resume affecting current autorun scope. This should be called after an unobserve() call.

staticinlinecease():Void

Unbinds and destroys current autorun. The name cease() has been chosed there so that it is unlikely to collide with other more common names suchs as stop, unbind etc... and should make it more recognizable, along with observe() and unobserve().

staticuntil(exprs:Dynamic):Autorun

Wait until the observable condition becomes true to execute the callback once (and only once). Creates an Autorun instance and returns it. Usage:

// Resulting autorun attached to "this" if available and a valid entity
until(something == true, callback);
// Add "null" if you don't want it to be attached to anything
until(null, something == true, callback);
// Attach to another entity
until(entity, something == true, callback);

staticassert(expr:Dynamic, ?reason:String):Dynamic

Assert the expression evaluates to true. This check is only done in debug builds and doesn't affect release builds.