Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1

THEMA:

Drawing rotated strings in a lua app tele window 09 Feb 2023 00:12 #1

  • davidmcq137
  • davidmcq137s Avatar Autor
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Beiträge: 75
  • Dank erhalten: 80
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
Anhänge:
Folgende Benutzer bedankten sich: WalterL, IG-Modellbau, frank.kleiner@gmx.net

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von davidmcq137.

Drawing rotated strings in a lua app tele window 09 Feb 2023 09:52 #2

  • IG-Modellbau
  • IG-Modellbaus Avatar
  • Abwesend
  • Moderator
  • Moderator
  • Beiträge: 3221
  • Dank erhalten: 2284
Hi Dave,
that's extrem nice!
Thank you for sharing this.

Ingmar

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Drawing rotated strings in a lua app tele window 10 Feb 2023 20:47 #3

  • davidmcq137
  • davidmcq137s Avatar Autor
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Beiträge: 75
  • Dank erhalten: 80
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.
Anhänge:
Folgende Benutzer bedankten sich: sunbeam, WalterL, IG-Modellbau, frank.kleiner@gmx.net

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

  • Seite:
  • 1
Moderatoren: ThornIG-Modellbau
Ladezeit der Seite: 0.228 Sekunden
Powered by Kunena Forum