jeff
01/18/2021, 1:53 AMtween
cause an ugly flicker. Is there a better way to avoid that than manually tracking Jobs? Example in 🧵jeff
01/18/2021, 1:53 AMclass TestScene : Scene() {
override suspend fun Container.sceneInit() {
val redBox = solidRect(100, 100, Colors.RED) {
xy(0, 0)
}
launch {
val firstJob = launch { redBox.tween(redBox::x[500], time = 3.seconds) }
delay(1500)
// firstJob.cancel() <-- this fixes the issue but is cumbersome
// at t=3000 when the first tween finishes, box jumps to 500, but then resumes its animation towards 0
launch { redBox.tween(redBox::x[0], time = 3.seconds) }
}
}
}
jeff
01/18/2021, 1:54 AMV2
cancelled prior calls. I don't know how feasible that is.Mayank
01/18/2021, 7:50 AMlaunch {
redBox.tween(redBox::x[500], time = 1.5.seconds)
redBox.tween(redBox::x[0], time = 3.seconds)
}
Deactivated User
01/18/2021, 11:21 AMjeff
01/18/2021, 3:12 PMjeff
01/18/2021, 3:27 PMDeactivated User
01/18/2021, 6:01 PMjeff
01/18/2021, 6:40 PM