method
Tween.value
Tween.value(handle) -> int
Returns the current interpolated value of a tween handle this frame — the number the engine advanced it to. Read it each frame to drive a position, an alpha, a scale. Once every segment has finished the value rests on the final target; Tween.done reports when that has happened. Returns 0 for an invalid handle.
Parameters
handlethe tween handle to readExample
program Demo {
property Pos { x: int = 0 }
property Tw { h: int = 0 }
model Mover { Pos, Tw }
handler Move phase Update {
let p = World.prop_id("Pos")
let t = World.prop_id("Tw")
let e = World.query_next(t, 0)
let h = World.get(e, t, World.field_id(t, "h"))
World.set(e, p, World.field_id(p, "x"), Tween.value(h))
}
}