Difference between revisions of "Reference"

From Gamebuino Wiki
Jump to: navigation, search
(core: collidePointPoint and collideRectRect added)
m ("Library" link removed)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
Here is listed and explained all Gamebuino specific functions (the Gamebuino [[Library]]).
+
Here is listed and explained all Gamebuino specific functions, part of the Gamebuino Library (see [[Getting started]] to install it).
  
 
See [http://arduino.cc/en/Reference/HomePage Arduino Reference] for general purpose/basic functions and data types.
 
See [http://arduino.cc/en/Reference/HomePage Arduino Reference] for general purpose/basic functions and data types.
Line 7: Line 7:
 
<div style="float:left;width:480px;margin-right:10px;">
 
<div style="float:left;width:480px;margin-right:10px;">
  
== core ==
+
== Core ==
 
<code>
 
<code>
 
* [[gb.begin]]()
 
* [[gb.begin]]()
 +
* [[gb.titleScreen]](''F("name")'', ''logo'')
 
* [[gb.update]]()
 
* [[gb.update]]()
 
* [[gb.setFrameRate]](fps)
 
* [[gb.setFrameRate]](fps)
Line 15: Line 16:
 
* [[gb.changeGame]]()
 
* [[gb.changeGame]]()
 
* [[gb.frameCount]]
 
* [[gb.frameCount]]
 +
* [[gb.getDefaultName]](string) //10 char
 
</code>
 
</code>
 
User interface :
 
User interface :
 
<code>
 
<code>
* [[gb.collidePointRect]](x1, y1 ,x2 ,y2, w, h)
 
* [[gb.collideRectRect]](x1, y1, w1, h1 ,x2 ,y2, w2, h2)
 
<code>
 
* [[gb.titleScreen]](''F("name")'', ''logo'')
 
 
* [[gb.menu]](menu, length)
 
* [[gb.menu]](menu, length)
 
* [[gb.keyboard]](string, length)
 
* [[gb.keyboard]](string, length)
 
* [[gb.popup]](F("text"), duration)
 
* [[gb.popup]](F("text"), duration)
* [[gb.getDefaultName]](string) //10 char
 
 
</code>
 
</code>
 
Physics:
 
Physics:
 
+
<code>
 +
* [[gb.collidePointRect]](x1,y1,x2,y2,w,h)
 +
* [[gb.collideRectRect]](x1,y1,w1,h1,x2,y2,w2,h2)
 +
* [[gb.collideBitmapBitmap]](x1, y1, b1, x2, y2, b2)
 +
</code>
 
Perfomance monitor :
 
Perfomance monitor :
 
<code>
 
<code>
Line 36: Line 37:
 
</code>
 
</code>
  
== buttons ==
+
== Buttons ==
 
<code>
 
<code>
 
* [[gb.buttons.pressed]](button)
 
* [[gb.buttons.pressed]](button)
Line 48: Line 49:
 
</code>
 
</code>
  
== sound ==
+
== Sound ==
For an overall explanation of how the sound library works, see [[Sound]].
+
* [[Sound]] : overall explanation of how the sound library works
  
 
Tracks<code>
 
Tracks<code>
Line 81: Line 82:
 
</code>
 
</code>
  
== battery ==
+
== Battery ==
 
<code>
 
<code>
 
* [[gb.battery.voltage]]
 
* [[gb.battery.voltage]]
Line 88: Line 89:
 
</code>
 
</code>
  
== backlight ==
+
== Backlight ==
 
<code>
 
<code>
 
* [[gb.backlight.set]](brightness)
 
* [[gb.backlight.set]](brightness)
Line 104: Line 105:
 
</div><div style="float:left;width:480px;margin-right:0;">
 
</div><div style="float:left;width:480px;margin-right:0;">
  
== display ==
+
== Display ==
 +
Useful constants: <code>LCDWIDTH, LCDHEIGHT, gb.display.fontWidth, gb.display.fontHeight</code>
 +
 
 
General :
 
General :
 
<code>
 
<code>
Line 140: Line 143:
 
* [[gb.display.fillCircle]](x, y, r)
 
* [[gb.display.fillCircle]](x, y, r)
 
* [[gb.display.drawCircleHelper]](x, y, r, corner)
 
* [[gb.display.drawCircleHelper]](x, y, r, corner)
* [[gb.display.fillCircleHelper]](x, y, r, corner)
+
* [[gb.display.fillCircleHelper]](x, y, r, corner, delta)
 
</code>
 
</code>
  
Line 159: Line 162:
 
<code>
 
<code>
 
* [[gb.display.print]](text or numbers)
 
* [[gb.display.print]](text or numbers)
 +
* [[gb.display.println]](text or numbers)
 
* [[gb.display.drawChar]](x, y, char, size)
 
* [[gb.display.drawChar]](x, y, char, size)
 
* [[gb.display.setFont]](font)
 
* [[gb.display.setFont]](font)
Line 166: Line 170:
 
* [[gb.display.textWrap]] = true/false
 
* [[gb.display.textWrap]] = true/false
 
</code>
 
</code>
Useful constants: <code>LCDWIDTH, LCDHEIGHT, gb.display.fontWidth, gb.display.fontHeight</code>
+
 
 +
Advanced :
 +
<code>
 +
* [[gb.display.getBuffer]]()
 +
* [[gb.display.getBitmapPixel]](bitmap, x, y)
 +
</code>
  
 
</div>
 
</div>

Latest revision as of 2014-09-06T12:22:52

Here is listed and explained all Gamebuino specific functions, part of the Gamebuino Library (see Getting started to install it).

See Arduino Reference for general purpose/basic functions and data types.

Note: Arguments in italic are optional.

Core

User interface :

Physics:

Perfomance monitor :

Buttons

buttons:

BTN_A, BTN_B, BTN_C, BTN_UP, BTN_RIGHT, BTN_DOWN, BTN_LEFT

Sound

  • Sound : overall explanation of how the sound library works

Tracks

Pattern

Notes & commands

Build-in sounds

Misc

Battery

Backlight

The following should be set using SETTINGS.HEX

Display

Useful constants: LCDWIDTH, LCDHEIGHT, gb.display.fontWidth, gb.display.fontHeight

General :

Pixels :

Lines :

Rectangles :

Circles :

Triangles :

Bitmaps :

  • rotation: NOROT, ROTCCW, ROT180, ROTCW
  • flip: NOFLIP, FLIPH, FLIPV, FLIPVH

Text :

Advanced :