Ticker

object Ticker

Calls tick related methods every frame. The order of operations :

  1. Management.preTick

  2. Director.preTick

  3. Behaviour.tick

  4. Director.preTick

  5. Management.preTick

Note. Behaviour.tick is only called for top-level Actors. i.e. those whose parent is a Stage. Child actors (whose parent is another Actor) are NOT called. If child actors need to be ticked, then this is the responsibility of the parent actor's behaviour. e.g.

class MyParentBehaviour : Behaviour {
    override fun tick( actor : Actor, seconds : Float ) {
        // Actions to perform before the children...

        for (child in actor.children) {
            child.behaviour.tick( child, seconds )
        }

        // Actions to perform after the children...
    }
}

Properties

Link copied to clipboard
var now: Double

A timestamp (in milliseconds since the epoch) of the current tick. i.e. this remains fixed for an entire frame, and then jumps 1/60th of a second when the next tick happens.

Link copied to clipboard

A timestamp (in milliseconds since the epoch) of the previous tick.

Link copied to clipboard
Link copied to clipboard
val tickCounterProperty: IntProperty

Functions

Link copied to clipboard
fun reset()
Link copied to clipboard
fun tick(act: Act)