Simple Countdown Timer Demo


GeeXLab - Simple countdown demo

If you need a simple countdown timer, here is GeeXLab demo that should do the job. The demo is available in the full code sample pack in the gl-21/countdown/ folder. Just load the demo.xml file in GeeXLab and that’s all. I haven’t tested, but the demo should work on all OpenGL 2.1 capable platforms (Windows, Linux, macOS and Raspberry Pi with OpenGL desktop driver enabled).


GeeXLab - Simple countdown demo

To start / stop the countdown, press the SPACE key. To reset the countdown, press the BACKSPACE key.

The countdown duration can be set by editing the conf.lua file that contains these four lines:

countdown_hours = 0 -- number of hours
countdown_minutes = 3 -- number of minutes
countdown_seconds = 0 -- number of seconds
countdown_warning_seconds = 60 -- number of seconds
countdown_bg_image = "pexels-photo-241544.jpg" -- image in the data/ folder

The last 60 seconds, the color of the countdown is set to red. You can change this duration by setting the right value to the countdown_warning_seconds global variable.


GeeXLab - Simple countdown demo

And if you want to change the background image, just set the countdown_bg_image variable with the name of the image (that should be stored in the data/ folder).





Leave a Comment

Your email address will not be published. Required fields are marked *