-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gauge Needles #571
Comments
You can set the destination pivot position (e.g. x,y on the TFT). You can also set the pivot point for the Sprite, relative to the top left corner of the Sprite. The Sprite pivot point does not need to be within the bounds of the Sprite. Run and study the Sprite rotation examples which are commented. The library has no concept of layers, any compositing would need to be coded by yourself. The simplest approach to a gauge is to ensure the swept area of the needle does not pass over any other graphics. This make updates fast, for example try this:
|
Wow ! Thank you. is it possible to plot the needle over text? so that the Black Arc is "transparent"? that makes it longer and easier to see. |
There is no simple solution. For an arbitrary background you would have to create a copy of all pixels obliterated by the needle. When the needle moves the pixels that were obliterated would need to be redrawn and then the needle drawn in the new position. See "TFT_Meter_linear" and "Rotated_Sprite_2" examples. The solution for your needs is something you will have to work out and code yourself. |
I have updated the library and added a new "Animated_dial" example that will be of interest to you. This draws a needle over a jpeg image of a dial. |
Hi @Bodmer , i am testing your amazing Animated_dial example, when it sweeps it deletes the numbers in the background, how can one solve this? |
To operate correctly the TFT screen must support reading pixel data. The TFT_ReadWrite_Test example sketch will text this. |
Thank you for your help! Turns out my GC9A01 doesnt support reading pixel data :( |
Hello, I found this Thread few days ago and when I saw this image I decided to make car dashboard and gauges. I used pure tft_espi and whole design is created using simple lines ,rectangles, circles ... |
Hi Bodmer!
I want to make a nice looking gauge like this:
You can see that the neede start is not in center, how is this possible to offset?
is it possible to have a layer 1 (background) with the gauge face and a second layer 2 with the needle? so I dont have to draw it each time the needle position changes?
I would really apreciate a little help or tip where to start...
The text was updated successfully, but these errors were encountered: