NRF SDK 0.9

Reference

SignalAnimation

Static and blinking images declared by the mod, animated using game time.

Usage context

ModulePackageSDK source
Kotlin/Nativenimbykotlin/src/nimby/SignalAnimation.kt

Public API for SDK 0.9.0-alpha.2. Each entry provides the Kotlin signature and its contract: what the value means, conditions of use and effects to understand. Choose imports from the module shown above.

Imports on this page
import nimby.SignalAnimation
import nimby.steady
import nimby.blink

SignalAnimation

nimby · class
class SignalAnimation

Appearance description constructed with steady or blink. The SDK handles timing; no mod thread or timer is needed. Its constructor is reserved for the SDK.

SignalAnimation.first

nimby · val
val first: String

Path of the image shown at simulation time zero and during the first half of the cycle.

SignalAnimation.alternate

nimby · val
val alternate: String

Path of the other blinking image. Equal to first for a steady image.

SignalAnimation.everyMs

nimby · val
val everyMs: Long

Duration of each image in simulated milliseconds; zero for steady. For blink, from 100 through 10000 inclusive.

SignalAnimation.frameAt

nimby · fun
fun frameAt(simulationMs: Long): String

Returns the image for a nonnegative simulation time in ms. The same instant always produces the same image, including while paused; useful for pure tests.

steady

nimby · fun
fun steady(path: String): SignalAnimation

Declares a steady catalogue image. A nonblank path of 1 to 95 UTF-8 bytes, without a NUL character; it must also be declared in construction.states.

blink

nimby · fun
fun blink(on: String, off: String, everyMs: Long): SignalAnimation

Alternates two declared images every 100 to 10000 simulated ms per image. 500 means 500 ms then 500 ms. Pause and acceleration are respected; signals with the same duration share the phase.