Drawing rotated strings in a lua app tele window

  • davidmcq137
  • davidmcq137's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 79
  • Thank you received: 87

TPL_KUNENA_MESSAGE_CREATED Drawing rotated strings in a lua app tele window

08 Feb 2023 23:12 - 08 Feb 2023 23:13
#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

Attachment Screen219_2023-02-09.png not found

Last edit: 08 Feb 2023 23:13 by davidmcq137.
The following user(s) said Thank You: WalterL, IG-Modellbau, frank.kleiner@gmx.net

Please Log in or Create an account to join the conversation.

  • IG-Modellbau
  • IG-Modellbau's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 3781
  • Thank you received: 2809

TPL_KUNENA_MESSAGE_REPLIED_NEW Drawing rotated strings in a lua app tele window

09 Feb 2023 08:52
#2
Hi Dave,
that's extrem nice!
Thank you for sharing this.

Ingmar

Please Log in or Create an account to join the conversation.

  • davidmcq137
  • davidmcq137's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 79
  • Thank you received: 87

TPL_KUNENA_MESSAGE_REPLIED_NEW Drawing rotated strings in a lua app tele window

10 Feb 2023 19: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.

Attachment Screenshotfrom2023-02-1014-45-08.png not found

The following user(s) said Thank You: sunbeam, WalterL, IG-Modellbau, frank.kleiner@gmx.net

Please Log in or Create an account to join the conversation.

Moderators: ThornIG-Modellbau
Time to create page: 0.327 seconds
Powered by Kunena Forum