Embed games and applications made in gly engine on your esp32, esp8266, raspbarry... and other devices using arduino ecosystem.
- Supports Lua 5.1 and 5.4 (include
GlyLua51.h
orGlyLua54.h
) - Supports 60+ FPS (depends on display capabilities and communication speed)
- Supports third-party graphics libraries (
Adafruit_GFX.h
orTFT_eSPI.h
) - Supports MEMPROG chunked loading to avoid heap usage for scripts
To install the Gly Core Native for Arduino, open the Arduino IDE, go to Sketch > Include Library > Manage Libraries, then search for "GlyEngine" in the Library Manager. Click Install next to the library name.
GlyEngine Arduino Core is highly customizable in C++, letting you adjust framerate, hardware acceleration, video drivers, and input debounce. It’s versatile for desktop, web, and adaptable to embedded devices. See other examples for more options.
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <GlyCore.h>
#include <GlyLua54.h>
#include <GlyEngine.h>
#include <GlyDisplayTFT.h>
#define TFT_CS 5
#define TFT_DC 16
#define TFT_RST 23
#define TFT_MOSI 19
#define TFT_SCLK 18
#define TFT_BL 4
const auto LuaCode = F(R"(
local App = {
title = "Game",
version = "1.0.0",
}
function App.draw(std, props)
std.draw.clear(std.color.green)
std.draw.color(std.color.black)
std.text.put(1, 1, "Hello!")
end
return App
)");
Adafruit_ST7789 tft(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
GlyCore engine(LuaCode, GlyEngine, &tft);
void setup() {
Serial.begin(115200);
engine.init(240, 135);
engine.setFramerate(1);
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH);
}
void loop() {
if (engine.hasErrors()) {
Serial.println(engine.getErrors());
for(;;);
}
engine.update();
}