gb.buttons.repeat

From Gamebuino Wiki
Revision as of 2014-05-20T21:05:36 by Rodot (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

Function used to trigger a repetitive action at a given period when a button is held down.

Syntax

gb.buttons.repeat(button, duration);

Parameters

  • button (byte): the identifier of the button, to choose from BTN_A, BTN_B, BTN_C, BTN_UP, BTN_RIGHT, BTN_DOWN, BTN_LEFT
  • duration (byte): the duration in number of frames (20 frames per second by default)

Returns

  • boolean: returns true every <duration> frames when the button is held down

Example

See also