cljfx

https://github.com/cljfx/cljfx
2019-04-18T19:04:43.005500Z

So I’m trying to animate a circle moving a cross the screen, but I’m not entirely sure how rendering works or how to use it, but using a loop like this and calling renderer isn’t working and I don’t understand why.

vlaaad 2019-04-18T19:40:03.005800Z

You probably need to put some (Thread/sleep some-time) into your loop: it completes almost immediately otherwise and app gets rendered asynchronously with latest description

vlaaad 2019-04-18T19:43:22.005900Z

There are also animation facilities in javafx, but they are not cljfxified since declarative animations are not that easy. But you can use extension lifecycles to just animate nodes, see example of fx/ext-on-instance-lifecycle here: https://github.com/cljfx/cljfx/blob/master/examples/e21_extension_lifecycles.clj#L20

2019-04-18T20:40:39.008100Z

Thanks I added Thread/sleep, I really don’t want to use jfx animations cause I’m going to make a simulation with planetary objects which will have their own velocity and acceleration.