gb.popup

From Gamebuino Wiki
Revision as of 2014-05-18T17:16:23 by Rodot (talk | contribs) (Created page with "{{DISPLAYTITLE:gb.popup}} __NOTOC__ == Description == Displays a pop-up message on the bottom of the screen for a given duration. == Syntax == <pre>gb.popup(F("Text"), durati...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Description

Displays a pop-up message on the bottom of the screen for a given duration.

Syntax

gb.popup(F("Text"), duration);

Parameters

  • F("Text") (progmem char*): The text to be popped-up
  • duration (byte): how long will the popup stay on screen, expressed in number of frames.

Returns

none

Example

#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;

void setup(){
  gb.begin(F("Popup example")); 
}

void loop(){
  if(gb.update()){
    if(gb.buttons.pressed(BTN_A))
      gb.popup(F("A pressed"),20);
    if(gb.buttons.pressed(BTN_B))
      gb.popup(F("B pressed"),20);
    if(gb.buttons.pressed(BTN_C))
      gb.popup(F("C pressed"),20);
  }
}

See also