Difference between revisions of "Gb.frameCount"
From Gamebuino Wiki
m (→Syntax) |
m ({{lowercase}}) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{lowercase}} |
__NOTOC__ | __NOTOC__ | ||
− | = Description = | + | == Description == |
This variable is incremented each time gb.update() is called, so it represents the number of frames rendered since the program began running. It should be preferred over millis() to measure time. It can be used for periodic event timing (like an animated bitmap) using modulo. | This variable is incremented each time gb.update() is called, so it represents the number of frames rendered since the program began running. It should be preferred over millis() to measure time. It can be used for periodic event timing (like an animated bitmap) using modulo. | ||
− | = Syntax = | + | == Syntax == |
− | int count = | + | <pre>int count = gb.frameCount;</pre> |
− | = Parameters = | + | == Parameters == |
none | none | ||
− | = Returns = | + | == Returns == |
− | Number of frames rendered since the program began running | + | unsigned long: Number of frames rendered since the program began running (20 frames per second by default) |
− | = Example = | + | == Example == |
− | < | + | <gistit>https://github.com/Rodot/Gamebuino/blob/master/libraries/Gamebuino/examples/5.Reference/core/frameCount/frameCount.ino</gistit> |
− | |||
− | |||
− | |||
− | + | == See also == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | = See also = | ||
*[[gb.update]] | *[[gb.update]] | ||
*[http://arduino.cc/en/Reference/modulo Modulo (Arduino)] | *[http://arduino.cc/en/Reference/modulo Modulo (Arduino)] |
Latest revision as of 2014-05-20T20:03:31
Description
This variable is incremented each time gb.update() is called, so it represents the number of frames rendered since the program began running. It should be preferred over millis() to measure time. It can be used for periodic event timing (like an animated bitmap) using modulo.
Syntax
int count = gb.frameCount;
Parameters
none
Returns
unsigned long: Number of frames rendered since the program began running (20 frames per second by default)
Example