Kraken Logo

Kraken Engine

DocumentationGuidesShowcaseCommunity
Ctrl
K
Navigating the Docs
Building Docs
Overview
Anchor
AnimationController
Audio
Batcher
Body
Camera
Capsule
CastHit
CharacterBody
Circle
Collision
Color
DistanceJoint
Effect
Event
FilterJoint
Flip (Texture)
Font
ImageLayer
InputAction
Joint
Layer
Line
Map
MapObject
Mask
MotorJoint
MouseJoint
ObjectGroup
Orchestrator
PixelArray
PolarCoordinate
Polygon
PrismaticJoint
Rect
RevoluteJoint
RigidBody
Sample
Sampler
Shader
SheetStrip
StaticBody
Stream
Style
Terrain (TileSet)
Text
TextProperties
Texture
Tile (TileLayer)
Tile (TileSet)
TileLayer
TileResult (TileLayer)
TileSet
Timer
Transform
Tween
Vec2
Vertex
WeldJoint
WheelJoint
World

Built bydurkisneer1.Kraken Engine is open source and available onGitHub.

  1. Docs
  2. Classes
  3. Timer

Timer

A timer for tracking countdown durations with pause/resume functionality.

Constructor

  • Timer(duration: float) → TimerTimer(duration: float) → Timer

A timer for tracking countdown durations with pause/resume functionality.

Properties


NameDescriptionType
donebool: True if the timer has finished counting down, False otherwise.bool
elapsed_timefloat: The time elapsed since the timer was started, in seconds.float
progressfloat: The completion progress of the timer as a value between 0.0 and 1.0.float
time_remainingfloat: The remaining time in seconds before the timer completes.float

Methods


Pause

pause() → Nonepause() → None

Pause the timer countdown.

The timer will stop counting down but retain its current state. Use resume() to continue the countdown from where it was paused. Has no effect if the timer is not started or already paused.

Reset

reset() → Nonereset() → None

Reset the timer to its initial state.

Stops the timer and resets it back to its initial, unstarted state. The timer can be started again with start() after being reset.

Restart

restart() → Nonerestart() → None

Restart the timer countdown.

This is a convenience method that combines reset() and start() into one call.

Resume

resume() → Noneresume() → None

Resume a paused timer countdown.

Continues the countdown from where it was paused. Has no effect if the timer is not started or not currently paused.

Start

start() → Nonestart() → None

Start or restart the timer countdown.

This begins the countdown from the full duration. If the timer was previously started, this will reset it back to the beginning.

PreviousTileSet
NextTransform

On this page

ConstructorPropertiesMethodsPauseResetRestartResumeStart