class Godot::TimerHandle

Overview

A handle representing an active recurring or delayed timer. Provides inspection and early cancellation/pausing capabilities.

Defined in:

libgodot/timer.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

try?(&)
try?
try?

Constructor Detail

def self.new(interval_sec : Float64, node : Godot::Node | Nil = nil, timer : Godot::Timer | Nil = nil, scene_tree_timer : Godot::SceneTreeTimer | Nil = nil) #

Instance Method Detail

def advance(delta : Float64) : Bool #

Advances time by delta, returning true if the timer should tick


def cancel : Void #

Cancels the timer immediately. No further callbacks will fire.


def cancelled? : Bool #

def elapsed : Float64 #

Alias for elapsed_time


def elapsed_time : Float64 #

def finished? : Bool #

Returns true if the timer has finished (either cancelled or stopped)


def interval_sec : Float64 #

def node : Godot::Node | Nil #

def pause : Void #

Temporarily pauses tick accumulation


def paused? : Bool #

def record_tick! : Int64 #

Explicitly registers a tick event and increments tick_count


def reset : Void #

Resets elapsed time and tick counter


def resume : Void #

Resumes tick accumulation


def running? : Bool #

def stop : Void #

Alias for cancel


def tick_count : Int64 #

def time_left : Float64 #

Returns estimated remaining time before next tick