Bottle 2D - Lua API 1.0.0
All you need to create games using bottle2D.
Public Member Functions | Public Attributes

Chronometer Class Reference

Chronometer event, to send event on each frame while the time is not elapsed, see Screen::RegisterChronometer to register a chronometer event. More...

#include <header.hpp>

Inheritance diagram for Chronometer:
EventHandlerBase

List of all members.

Public Member Functions

number GetTotalTime ()
 Get the total time that the chronometer should count (when total time is elapsed, ratio is 1).
nil SetTotalTime (number totalTime)
 Set the total time that the chronometer should count (when total time is elapsed, ratio is 1).
number GetRatio ()
 Get the current time ratio(elapsed time / total time).
nil SetRatio (number newRatio)
 Force the chronometer to force its current ratio.
nil Restart ()
 Restart the chronometer (set ratio and elapsed time to 0).
nil Start ()
 Start the chronometer.
nil Stop ()
 Stop / pause the chronometer.
bool IsRunning ()
 Return true if the chronometer is running, false overwise.

Public Attributes

float totalTime
 Access the total time that the chronometer should count (when total time is elapsed, ratio is 1).
float ratio
 Access the current time ratio(elapsed time / total time).

Detailed Description

Chronometer event, to send event on each frame while the time is not elapsed, see Screen::RegisterChronometer to register a chronometer event.


Member Function Documentation

number Chronometer::GetRatio ( )

Get the current time ratio(elapsed time / total time).

number Chronometer::GetTotalTime ( )

Get the total time that the chronometer should count (when total time is elapsed, ratio is 1).

bool Chronometer::IsRunning ( )

Return true if the chronometer is running, false overwise.

nil Chronometer::Restart ( )

Restart the chronometer (set ratio and elapsed time to 0).

nil Chronometer::SetRatio ( number  newRatio)

Force the chronometer to force its current ratio.

nil Chronometer::SetTotalTime ( number  totalTime)

Set the total time that the chronometer should count (when total time is elapsed, ratio is 1).

nil Chronometer::Start ( )

Start the chronometer.

nil Chronometer::Stop ( )

Stop / pause the chronometer.


Member Data Documentation

Access the current time ratio(elapsed time / total time).

Access the total time that the chronometer should count (when total time is elapsed, ratio is 1).


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables