Stormworks: Build and Rescue

Stormworks: Build and Rescue

33 beoordelingen
*LUA* Scalable Text
   
Prijs
Toevoegen aan favorieten
Toegevoegd aan favorieten
Verwijderen uit favorieten
Bestandsgrootte
Geplaatst op
199.624 KB
22 nov 2019 om 10:30
1 wijzigingsnotitie (weergeven)

Abonneren om te downloaden
*LUA* Scalable Text

In 1 verzameling van Tajin
Quality microcontollers for every occasion
21 items
Omschrijving
This draws a custom made, fully scalable font on any connected screen.
It an be used as is or be included into an existing MC.


The script is by default configured to fit the whole screen and takes its settings from the properties in the MC. You can change the position and size of the text the same way you would draw a rectangle (x,y,w,h). The text automatically scales to fit inside that rectangle. Color and Fontweight are adjustable.

In short:
- scalable
- adjustable weight
- colorable
- Text is in capitals
- Default Charset includes the following: "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !?+-:_.,"


The charset can also be extended or even used to draw other things... if you understand how it works. (Hint: it's somewhat similar to svg)
22 opmerkingen
MikGaming/DJ Mike 21 aug 2023 om 13:44 
how to skip a line ?
Ghost 25 jul 2023 om 3:29 
Nevermind, I found a solution by deleting the property text and putting TXT(Text, ....) in the fonction onDraw instead of TXT(prT("Text"), ....
Sorry for disturbing you, and great script by the way !
Ghost 25 jul 2023 om 3:25 
Is there any way we can put the text inside the lua script instead of in a property text ? I want the value of my text to change, like when number == 0 then text="a" but I can't really do that with property text.
Tajin  [auteur] 11 feb 2023 om 13:09 
Because you can't send text via logic connections unless you encode it and if you just want to display numbers, that is really quite easy to change.
Galactian 11 feb 2023 om 11:28 
why would you spend so much time on this and not let the value change so systems can change what they display
Ω Compu 7 feb 2023 om 23:27 
i have narrowed the problem down further, the 8 is correct only at font weight 6 and below, any font weight above 6 breaks the 8
Ω Compu 7 feb 2023 om 19:17 
i'm not in that discord server
Tajin  [auteur] 7 feb 2023 om 19:16 
I posted an example how to do that on discord a while ago if you're interested:
https://discord.com/channels/357480372084408322/578586360336875520/671338074709426187
Tajin  [auteur] 7 feb 2023 om 19:12