🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5Dial and graphics and canvas and sprite: why so hard to figure out??

    Scheduled Pinned Locked Moved General
    1 Posts 1 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U Offline
      uberdweeb
      last edited by

      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.

      1 Reply Last reply Reply Quote 0

      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
      • First post
        Last post