wb32_splash:基本的字形顯示、圖像顯示
-
這個範例是介紹基本繪圖程式庫的用法。
程式打包在此:wb32_spash.zip
原始程式如下,主程式只有區區三十行左右:
/*
* Intro Splash -- WiFiBoy32 Demo Code for Arduino/ESP32
*
* Oct 13, 2017 Created. (derek@wifiboy.org)
*
*/
#include "wifiboy32.h"
#include "wb32-demo2.h"uint16_t pbuf[128*160];
void setup()
{
wb32_init();
wb32_fillScreen(0);
for(int i=0; i<128*160; i++) pbuf[i]=img[i*2]*256+img[i*2+1];
wb32_drawImage(56,120,128,160, (uint16_t pbuf);wb32_setTextColor(wbCYAN, wbCYAN);
wb32_drawString("WiFiBoy", 24, 30, 1, 6);
wb32_setTextColor(wbRED, wbRED);
wb32_drawString("32", 185, 44, 1, 4);
wb32_drawFastHLine(10, 80, 220, wbYELLOW);
wb32_drawFastHLine(10, 81, 220, wbYELLOW);
wb32_setTextColor(wbWHITE, wbWHITE);
wb32_drawString("Make Your Own Game!", 24, 88, 2, 2);
wb32_setTextColor(wbGREEN, wbGREEN);
wb32_drawString("(C)2017 WiFiBoy.Org, All Rights Reserved", 20, 300, 2, 1);
}void loop() {
}