Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_firebase_timer

Plugin, ACE table, Discussion thread
Dependence: 
rex_firebase_apiV3

Introduction
Get elapsed interval from firebase.

Usage
Sample capx, sample capx-V3


Start timer
Call "
Action:Start" to re-start a timer.
"
Condition:On start timer" will be triggered while starting success, otherwise "Condition:On start timer error" will be triggered.

Get timer
Call
  • "Action:Get or start" to get a timer , or start a timer if not exists.
  • "Action:Get" to get a timer.
"Condition:On get timer" will be triggered while get timer back success, otherwise "Condition:On get timer error" will be triggered.
"
Condition:Is valid" returns true if get a timer.
Time-out interval
The parameter "Interval" in
"Condition:On start timer" or "Condition:On get timer" is a time-out interval which is an optional value in this timer to test if it is time-out now by "
Condition:Is time-out" under "Condition:On get timer".
Expression of timer
These expressions of a timer could be used under
"Condition:On start timer" or
"Condition:On get timer"-
  • Expression:LastUserID, Expression:LastTimerName: owner ID of this timer, and timer name.
  • Expression:LastStartTimestamp, Expression:LastCurrentTimestamp: start time or current time, uses it to show current date and time.
  • Expression:LastElapsedTime: current time - start time , uses it in stopwatch.
  • Expression:LastTimeoutInterval: time-out interval , uses it in count down timer.
  • Expression:LastRemainInterval: elapsed time - time-out interval , uses it in count down timer.

Remove timer
Call "Action:Remove" to remove the timer. "Condition:On remove timer complete" will be triggered while removing success, otherwise "Condition:On remove timer error" will be triggered.

On disconnect
Sample capx, sample capx-V3
Call "
Action:Start on disconnect" will start a timer while disconnect. It could be used to get the off-game time without polling i.e. start timer every N second.
"Action:Delete on disconnect" will remove a timer while disconnect.


Compare with rex_time_away , rex_parse_timer
rex_time_away or rex_time_awayL gets the elapsed time from local system time, which might be changed by user.
This plugin
gets the elapsed time from firebase service. It might be more credible.

Compare with rex_parse_timer
The ACE are almost the same. The different are -
  1. rex_parse_timer uses parse service, this plugin uses firebase service
  2. This plugin provides "Action:Start on disconnect" to get the off-game time more easier.
_

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About