NOBのArduino日記!

NOBのArduino日記!

趣味は車・バイク・自転車・ラジコン・電子工作です。

Gamebuinoの使い方(リファレンス)

■その他! 目次

 

■記事リンク一覧!

 

サンプルゲーム!

  1. Gamebuino!(2048)
  2. Gamebuinoで自作ゲーム!

準備!

  1. Gamebuinoの使い方(ライブラリのインストール編)
  2. Gamebuinoの使い方(HEXファイル出力編)
  3. Gamebuinoの使い方(エミュレート編)

ライブラリ!

コア

  1. gb.begin()
  2. gb.titleScreen(F("name"), logo)
  3. gb.update()
  4. gb.setFrameRate(fps)
  5. gb.pickRandomSeed()
  6. gb.changeGame()
  7. gb.frameCount()
  8. gb.getDefaultName(string)//10 char

ユーザーインターフェース

  1. gb.menu(menu, length)
  2. gb.keyboard(string, length)
  3. gb.popup(F("text"), duration)

物理

  1. gb.collidePointRect(x1,y1,x2,y2,w,h)
  2. gb.collideRectRect(x1,y1,w1,h1,x2,y2,w2,h2)
  3. gb.collideBitmapBitmap(x1, y1, b1, x2, y2, b2)

パフォーマンスモニタ

  1. gb.getCpuLoad()
  2. gb.getFreeRam()
  3. gb.frameDurationMicros()

ボタン

  1. gb.buttons.pressed(button)
  2. gb.buttons.released(button)
  3. gb.buttons.held(button, duration)
  4. gb.buttons.repeat(button, period)
  5. gb.buttons.timeHeld(button)
  6. ※ボタン:BTN_A, BTN_B, BTN_C, BTN_UP, BTN_RIGHT, BTN_DOWN, BTN_LEFT<

  1. サウンドライブラリとは?
トラック
  1. gb.sound.playTrack(track, channel)
  2. gb.sound.stopTrack(channel)
  3. gb.sound.changePatternSet(patternSet, channel)
パターン
  1. gb.sound.playPattern(sound, channel)
  2. gb.sound.stopPattern(channel)
  3. gb.sound.setPatternLooping(boolean, channel)
  4. gb.sound.isPlaying(channel)
ノートとコマンド
  1. gb.sound.playNote(pitch, duration, channel)
  2. gb.sound.command(command, X, Y, channel)
  3. gb.sound.changeInstrumentSet(instrumentSet, channel)
ビルドインサウンド
  1. gb.sound.playOK()
  2. gb.sound.playCancel()
  3. gb.sound.playTick()
その他
  1. gb.sound.setVolume(volume, channel)
  2. gb.sound.getVolume(channel)
  3. gb.sound.setInstruments(instruments, channel)
  4. gb.sound.prescaler()

バッテリー

  1. gb.battery.voltage
  2. gb.battery.level
  3. gb.battery.show = true/false

バックライト

  1. gb.backlight.set(brightness)
  2. gb.backlight.automatic = true/false
  3. gb.backlight.backlightValue
  4. gb.backlight.ambientLight
  5. ※次はSETTINGS.HEXを使用して設定する必要があります
  6. gb.backlight.backlightMin = 0 to 255
  7. gb.backlight.backlightMax = 0 to 255
  8. gb.backlight.ambientLightMin = 0 to 1024
  9. gb.backlight.ambientLightMax = 0 to 1024

表示

  1. ※便利な定数: LCDWIDTH
  2. ※便利な定数: LCDHEIGHT
  3. ※便利な定数: Lb.display.fontWidth
  4. ※便利な定数: Lb.display.fontHeight
一般
  1. gb.display.clear()
  2. gb.display.update()
  3. gb.display.fillScreen(color)
  4. gb.display.setColor(color, background)
  5. gb.display.persistence = true/false
ピクセル
  1. gb.display.drawPixel(x, y)
  2. gb.display.getPixel(x, y)
  1. gb.display.drawLine(x0, y0, x1, y1)
  2. gb.display.drawFastVLine(x, y, h)
  3. gb.display.drawFastHLine(x, y, w)
長方形
  1. gb.display.drawRect(x, y, w, h)
  2. gb.display.fillRect(x, y, w, h)
  3. gb.display.drawRoundRect(x, y, w, h, r)
  4. gb.display.fillRoundRect(x, y, w, h, r)
円形
  1. gb.display.drawCircle(x, y, r)
  2. gb.display.fillCircle(x, y, r)
  3. gb.display.drawCircleHelper(x, y, r, corner)
  4. gb.display.fillCircleHelper(x, y, r, corner, delta)
三角形
  1. gb.display.drawTriangle(x0,y0,x1,y1,x2,y2)
  2. gb.display.fillTriangle(x0,y0,x1,y1,x2,y2)
ビットマップ
  1. gb.display.drawBitmap(x,y,bitmap,rotation,flip)
  2. ※回転: NOROT, ROTCCW, ROT180, ROTCW
  3. ※反転: NOFLIP, FLIPH, FLIPV, FLIPVH
文字
  1. gb.display.print(text or numbers)
  2. gb.display.println(text or numbers)
  3. gb.display.drawChar(x, y, char, size)
  4. gb.display.setFont(font)
  5. gb.display.cursorX = x
  6. gb.display.cursorY = y
  7. gb.display.fontSize = size
  8. gb.display.textWrap = true/false
上級者
  1. gb.display.getBuffer()
  2. gb.display.getBitmapPixel(bitmap, x, y)
 
イメージ 1 イメージ 3
励みになりますのでよければクリック下さい(^o^)/

↩【NOBのArduino日記!】目次に戻る