Difference between revisions of "Gb.begin"

From Gamebuino Wiki
Jump to: navigation, search
m (Example: added loop)
(Changed title depth)
Line 1: Line 1:
 
{{DISPLAYTITLE:gb.begin}}
 
{{DISPLAYTITLE:gb.begin}}
 
__NOTOC__
 
__NOTOC__
= Description =
+
== Description ==
 
Initialize the Gamebuino and displays the startup screen. Should be called once at the beginning of the setup() function.
 
Initialize the Gamebuino and displays the startup screen. Should be called once at the beginning of the setup() function.
  
Line 7: Line 7:
 
<pre>gb.begin(F("name"), logo);</pre>
 
<pre>gb.begin(F("name"), logo);</pre>
  
= Parameters =
+
== Parameters ==
 
* F("name") ''(optional)'': Replace "name" with the name of your game (but keep the " "). Will be displayed in the start menu.
 
* F("name") ''(optional)'': Replace "name" with the name of your game (but keep the " "). Will be displayed in the start menu.
 
* logo ''(optional)'': The logo of your game. Any size from 8*8px up to 64*28px.
 
* logo ''(optional)'': The logo of your game. Any size from 8*8px up to 64*28px.
  
= Returns =
+
== Returns ==
 
none
 
none
  
= Example =
+
== Example ==
 
<pre>
 
<pre>
 
#include <SPI.h>
 
#include <SPI.h>
Line 45: Line 45:
 
</pre>
 
</pre>
  
= See also =
+
== See also ==

Revision as of 2014-05-18T09:56:39


Description

Initialize the Gamebuino and displays the startup screen. Should be called once at the beginning of the setup() function.

Syntax

gb.begin(F("name"), logo);

Parameters

  • F("name") (optional): Replace "name" with the name of your game (but keep the " "). Will be displayed in the start menu.
  • logo (optional): The logo of your game. Any size from 8*8px up to 64*28px.

Returns

none

Example

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

static unsigned char PROGMEM logo[]=
{
  8,8,
  B00000000,
  B00100100,
  B00011000,
  B01111110,
  B00111100,
  B01111110,
  B00111100,
  B00000000,
};

void setup(){
  // initialize the Gamebuino object
  gb.begin(F("Example game"), logo);
}

void loop(){
  if(gb.update()){
    gb.display.println("Hello world");
  }
}

See also