Stormworks: Build and Rescue

Stormworks: Build and Rescue

33 evaluări
*LUA* Scalable Text
   
Premiază
Adaugă la preferate
Preferat
Elimină din preferate
Dimensiunea fișierului
Postat
199.624 KB
22 nov. 2019 la 10:30
1 jurnal de actualizare ( vizionare )

Abonează-te pentru a descărca
*LUA* Scalable Text

În 1 colecție creată de Tajin
Quality microcontollers for every occasion
21 obiecte
Descriere
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 comentarii
MikGaming/DJ Mike 21 aug. 2023 la 13:44 
how to skip a line ?
Ghost 25 iul. 2023 la 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 iul. 2023 la 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  [autor] 11 febr. 2023 la 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 febr. 2023 la 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 febr. 2023 la 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 febr. 2023 la 19:17 
i'm not in that discord server
Tajin  [autor] 7 febr. 2023 la 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  [autor] 7 febr. 2023 la 19:12