Drawing rotated strings in a lua app tele window
- davidmcq137
-
Offline Autor
- Senior Mitglied
-
- Beiträge: 78
- Dank erhalten: 86
Drawing rotated strings in a lua app tele window wurde erstellt von davidmcq137
Posted 09 Feb. 2023 00:12 #1
Hi all,
For a project I am working on now, I needed to draw some rotated character strings .. in my case only numbers. I looked around for some good single line fonts and found an interesting website that had a nice simple font. It's an old-school-looking font. Links are in the app source file.
I was a little concerned about CPU usage, and it turns out if you draw it with the anti-alias rendering API it consumes about 2% of CPU per character drawn, which is manageable in my case.
You can find the code and a test app on my github page: github.com/davidmcq137/JetiLuaDFM/blob/0.../misclua/hp1345a.lua
I hope this is of some use to other lua app developers.
Dave
For a project I am working on now, I needed to draw some rotated character strings .. in my case only numbers. I looked around for some good single line fonts and found an interesting website that had a nice simple font. It's an old-school-looking font. Links are in the app source file.
I was a little concerned about CPU usage, and it turns out if you draw it with the anti-alias rendering API it consumes about 2% of CPU per character drawn, which is manageable in my case.
You can find the code and a test app on my github page: github.com/davidmcq137/JetiLuaDFM/blob/0.../misclua/hp1345a.lua
I hope this is of some use to other lua app developers.
Dave
Last Edit:09 Feb. 2023 00:13
von davidmcq137
Letzte Änderung: 09 Feb. 2023 00:13 von davidmcq137.
Folgende Benutzer bedankten sich: WalterL, IG-Modellbau, frank.kleiner@gmx.net
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- IG-Modellbau
-
Offline
- Moderator
-
- Beiträge: 3494
- Dank erhalten: 2581
IG-Modellbau antwortete auf Drawing rotated strings in a lua app tele window
Posted 09 Feb. 2023 09:52 #2
Hi Dave,
that's extrem nice!
Thank you for sharing this.
Ingmar
that's extrem nice!
Thank you for sharing this.
Ingmar
von IG-Modellbau
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- davidmcq137
-
Offline Autor
- Senior Mitglied
-
- Beiträge: 78
- Dank erhalten: 86
davidmcq137 antwortete auf Drawing rotated strings in a lua app tele window
Posted 10 Feb. 2023 20:47 #3
Sometimes when we are coding, we laugh out loud at dumb things we do (well, at least I do!)
First time I went to use this I realized I forgot to include the minus sign, so I could not do negative numbers...
Here is an update: github.com/davidmcq137/JetiLuaDFM/blob/1.../misclua/hp1345a.lua
The project I am working on is an instrument panel generator with a number of different gauges and widgets that are drawn with a drag and drop interface on a website .. then downloaded with a companion lua app to the TX. It uses the same pilot-specific data download idea as my maps app.
Here is the example panel that was driving this "characters on an angle" work. Soon I will be asking if anyone is interested in beta testing.
First time I went to use this I realized I forgot to include the minus sign, so I could not do negative numbers...
Here is an update: github.com/davidmcq137/JetiLuaDFM/blob/1.../misclua/hp1345a.lua
The project I am working on is an instrument panel generator with a number of different gauges and widgets that are drawn with a drag and drop interface on a website .. then downloaded with a companion lua app to the TX. It uses the same pilot-specific data download idea as my maps app.
Here is the example panel that was driving this "characters on an angle" work. Soon I will be asking if anyone is interested in beta testing.
von davidmcq137
Folgende Benutzer bedankten sich: sunbeam, WalterL, IG-Modellbau, frank.kleiner@gmx.net
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Moderatoren: Thorn, IG-Modellbau
Ladezeit der Seite: 0.991 Sekunden