M5Dial and graphics and canvas and sprite: why so hard to figure out??
-
I am trying to do sprites or canvas or something in the M5 Dial and had a hell of a time getting it to work. In the end I am not sure I did it right.
I see things about canvas and sprites but I don't know the relationship, and I can't figure out what is a M5Dial call, M5Canvas or what.
In the end I did:
M5GFX display;
M5Canvas canvas(&display);then followed with:
auto cfg = M5.config();
M5Dial.begin(cfg, true, true);
display.begin();seems inconsistent but worked.
In my loop I did:
display.startWrite();
canvas.createSprite(240, 240);
canvas.fillScreen(0xABE1);
canvas.setTextColor(WHITE);
canvas.setTextDatum(middle_center);
canvas.setFont(&fonts::Orbitron_Light_32);
canvas.setTextSize(1);
canvas.drawString("The Title", M5Dial.Display.width() / 2, 15);
canvas.pushSprite(0,0);
display.endWrite();In the rest of my code I always did stuff like:
M5Dial.Display.drawString("To Print", 30, 90);Are there M5Dial.Display equivalents to what I am trying to do?
The display is silky smooth without flickering now but I don't quite get it.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login