Difference between revisions of "Gb.popup"

From Gamebuino Wiki
Jump to: navigation, search
(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...")
 
m (Example: path changed to beta branch)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:gb.popup}}
+
{{lowercase}}
 
__NOTOC__
 
__NOTOC__
 
== Description ==
 
== Description ==
Line 9: Line 9:
 
== Parameters ==
 
== Parameters ==
 
* F("Text") (progmem char*): The text to be popped-up
 
* 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.
+
* duration (byte): how long will the popup stay on screen, expressed in number of frames (20 frames per second by default)
  
 
== Returns ==
 
== Returns ==
Line 15: Line 15:
  
 
== Example ==
 
== Example ==
<pre>
+
<gistit>https://github.com/Rodot/Gamebuino/blob/beta/libraries/Gamebuino/examples/5.Reference/interface/popup/popup.ino</gistit>
#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);
 
  }
 
}
 
</pre>
 
  
 
== See also ==
 
== See also ==
 
*[[gb.update]]
 
*[[gb.update]]

Latest revision as of 2014-09-05T21:54:55

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 (20 frames per second by default)

Returns

none

Example

See also