Reference
SignalAnimation
Static and blinking images declared by the mod, animated using game time.
Usage context
| Module | Package | SDK source |
|---|---|---|
| Kotlin/Native | nimby | kotlin/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.
import nimby.SignalAnimation
import nimby.steady
import nimby.blinkSignalAnimation
class SignalAnimationAppearance 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
val first: StringPath of the image shown at simulation time zero and during the first half of the cycle.
SignalAnimation.alternate
val alternate: StringPath of the other blinking image. Equal to first for a steady image.
SignalAnimation.everyMs
val everyMs: LongDuration of each image in simulated milliseconds; zero for steady. For blink, from 100 through 10000 inclusive.
SignalAnimation.frameAt
fun frameAt(simulationMs: Long): StringReturns 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
fun steady(path: String): SignalAnimationDeclares 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
fun blink(on: String, off: String, everyMs: Long): SignalAnimationAlternates 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.