class_timer - dragonsoulz/godot GitHub Wiki

Timer

####Inherits: Node ####Category: Core

Brief Description

Member Functions

Signals

  • timeout ( )

Description

Timer node. This is a simple node that will emit a timeout callback when the timer runs out. It can optinally be set to loop.

Member Function Description

set_wait_time

  • void set_wait_time ( float time_sec )

Set wait time. When the time is over, it will emit timeout signal.

get_wait_time

  • float get_wait_time ( ) const

Return the wait time. When the time is over, it will emit timeout signal.

set_one_shot

  • void set_one_shot ( bool enable )

Set as one-shot. If true, timer will stop after timeout, otherwise it will automatically restart.

is_one_shot

  • bool is_one_shot ( ) const

Return true if is set as one-shot. If true, timer will stop after timeout, otherwise it will automatically restart.

set_autostart

  • void set_autostart ( bool enable )

Set to automatically start when entering the scene.

has_autostart

  • bool has_autostart ( ) const

Return true if set to automatically start when entering the scene.

start

  • void start ( )

Start the timer.

stop

  • void stop ( )

Stop (cancel) the timer.

get_time_left

  • float get_time_left ( ) const

Return the time left for timeout if the timer is active.