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

    Centre a label on M5Stack

    UIFlow
    3
    3
    2.6k
    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.
    • E
      elettronico
      last edited by

      Do you know how I can automatically centre a label in the exact centre of the screen?

      1 Reply Last reply Reply Quote 0
      • H
        holofloh
        last edited by

        I assume you have changing text in the label. For the Y-axis set the label manually to the half of screen height minus the half of label height. The X-axis can be calculated by using half of screen width and half of label width label0.get_width().

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

          @holofloh wow, I have never considered this, thanks for posting. I will add it to my guides.

          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