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

    Core modules have rectangles/triangles in the UI designer, Core2 does not

    UIFlow
    4
    6
    5.4k
    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.
    • SlartibartfastS
      Slartibartfast
      last edited by

      I'm trying to migrate an application to the Core2 from Core and I made extensive use of the triangle/rectangle UI things but those don't appear to be supported in Core2. Any idea why or am I missing something?

      1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3
        last edited by

        Core2 uses LVGL Graphics library where as core doesn't. looks like primitive shapes are not available in LVGL in UIFlow.

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        teastainT 1 Reply Last reply Reply Quote 1
        • felmueF
          felmue
          last edited by

          Hello @Slartibartfast

          not ideal, but you could try the following: while your M5Stack application is loaded in UIFlow, get the rectangles, circles and triangles definitions from the python view. E.g.

          rectangle0 = M5Rect(35, 38, 30, 30, 0xFFFFFF, 0xFFFFFF)
          circle0 = M5Circle(93, 95, 15, 0xFFFFFF, 0xFFFFFF)
          triangle0 = M5Triangle(137, 120, 106, 149, 166, 149, 0xFFFFFF, 0xFFFFFF)
          

          then switch to M5Core2 and add those definitions together with:

          from m5ui import *
          screen.set_screen_bg_color(0x000000)
          

          into an Execute Code block at the beginning of your M5Core2 application. E.g.

          0_1664784734156_UIFlowShapesInExecuteBlock20221003.png

          If you programmatically changed those shapes you probably need to put those commands into Execute Code blocks as well.

          I guess one alternative is to stay in the Python view altogether or to use the shapes from the M5Core2 Graphic section.

          Thanks
          Felix

          GPIO translation table M5Stack / M5Core2
          Information about various M5Stack products.
          Code examples

          1 Reply Last reply Reply Quote 1
          • SlartibartfastS
            Slartibartfast
            last edited by

            Thanks everyone for the suggestions!

            1 Reply Last reply Reply Quote 0
            • teastainT
              teastain @ajb2k3
              last edited by

              Adam, I did not know Core2 uses LVGL!
              You are a Wizard!
              -Terry

              Cheers, Terry!

              100% M5Stack addict with several drawers full of product!

              ajb2k3A 1 Reply Last reply Reply Quote 1
              • ajb2k3A
                ajb2k3 @teastain
                last edited by

                @teastain I try to be helpful!

                UIFlow, so easy an adult can learn it!
                If I don't know it, be patient!
                I've ether not learned it or am too drunk to remember it!
                Author of the WIP UIFlow Handbook!
                M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post