Stormworks: Build and Rescue

Stormworks: Build and Rescue

Compact Resizable Rotatable Custom Font
23 Comments
RedPug 26 Aug, 2024 @ 4:23pm 
fixed with the following change:

if FONT_D[ci]&p==p then
xx,yy=((i-1)%3)*s-((r>2 and FONT_D[ci]&1==1)and s*2 or 0),((i-1)//3)*s
if r%2==1 then
drf(x+xx,y+yy,s,s)
else
drf(x+5-yy,y+xx,s,s)
end
end

added "-((r>2 and FONT_D[ci]&1==1)and s*2 or 0)" to the xx term on line 2 of this portion of code.
RedPug 26 Aug, 2024 @ 2:46pm 
it appears that the 1-wide characters are being rendered inside the previous character.
RedPug 26 Aug, 2024 @ 2:36pm 
For whatever reason, one-wide characters (such as .,!) don't render with rotated to down or left. Everything else seems to be fine.
AVUMP 12 Aug, 2024 @ 8:06am 
how do get numbers from outside input? I`m put R=getnumber(1) after functionTick and "text" change to R. It is'n work.
D_Bones 17 Jul, 2024 @ 12:38pm 
Damn, exactly what I was looking for! A pure gem... Thank you for sharing :)
BobGrey 9 Jan, 2024 @ 8:16pm 
Nevermind. You need to add it in via tostring(variable).

For example, speed is being read through channel 4 to variable S, so in function onTick() I have S = input.getNumber(4) and in function onDraw () I have dst(x,y,tostring(S),size==1,rotation==1,is_monospace==false)
BobGrey 9 Jan, 2024 @ 8:08pm 
How to use variables? I want to use this for a speedometer, but when I enter the variable in for text, it says "25: Attempt to index a number value (local 'T')"
Xerxes 7 May, 2023 @ 1:15am 
you sir are a god
Shillelagh 11 Feb, 2023 @ 2:48pm 
You need to cast it to a string.
It also sounds like the error is on you, the error you described is a mix between two different ones. You either have t() if it's trying to call or t[] if you're trying to index.
Galactian 11 Feb, 2023 @ 12:31pm 
why would you spend so much time on this and not even let the value change
MarcusTheGamer 3 Sep, 2022 @ 1:46pm 
Why does the text part of the DFT command not support variables? I just get the error that its trying call index a number value (local't') on line 11
solarplexusclowngliderzelensky 18 Feb, 2022 @ 9:55am 
Best one on the workshop :steamthumbsup:
lexignatov 29 Jan, 2022 @ 4:34am 
Great job!
Shillelagh 20 Nov, 2021 @ 8:45pm 
What don't you get?
Hawken 20 Nov, 2021 @ 8:39pm 
i dont get this at all.
Shillelagh 5 Nov, 2021 @ 4:48am 
Oh my god, a life saver.
OMNI 21 Oct, 2021 @ 5:45am 
I made a font edit if anyone wants to use it.... Basically block numbers and a few letters adjusted.

Font1: 00019209B400AAAA793CA54A555690015244449415500BA00049038000092549F6DE592EE7CEE79EB792F39EF3DEE492F7DEF79E104110490A201C7008A04504

Font2: FFFE57DAD75C7246D6DCF34EF3487256B7DAE92E64D4B75A924EBEDAF6DA56D4D74856B2D75A711CE924B6DEB6A4B6FAB55AB524E54ED24C911264965400000E

puipuix  [author] 29 Aug, 2021 @ 11:51am 
Credit to @Trapdoor for that. It works by writing how to draw the different characters in few property text.
Each character is represented by 3x5 pixel so we can write 1 if the pixel is black and 0 if the pixel is transparent so that makes a binary value. For example a letter will looks like 100011100101000. To be more compact I use hexadecimal number instead of binary but it works the same.
RedPug 28 Aug, 2021 @ 11:25pm 
what the fudge how did you manage this in less than 700 characters!!!???
puipuix  [author] 14 Aug, 2021 @ 2:09am 
@Keptin I don't use Pony IDE but it looks like it works for @Newbie McNoobface so I guess you can copy the text from the properties into the FONT variable

@Trapdoor Yes your idea of using binary to represent the font was wonderfull !
Newbie McNoobface 12 Aug, 2021 @ 5:37pm 
Thank you!

@Keptin: Works fine for me... you just have to cut&paste the properties (Check the "Properties" tab usually on the top left.)
Trapdooor 12 Aug, 2021 @ 5:33pm 
I guess I woke something up in you. :D Incredible work man. Good job!
Keptin 11 Aug, 2021 @ 8:05pm 
Very cool stuff puipuix! Is there any way to use this in Pony IDE for testing when not in-game?