Stormworks: Build and Rescue

Stormworks: Build and Rescue

Compact Resizable Rotatable Custom Font
23 条留言
RedPug 2024 年 8 月 26 日 下午 4:23 
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 2024 年 8 月 26 日 下午 2:46 
it appears that the 1-wide characters are being rendered inside the previous character.
RedPug 2024 年 8 月 26 日 下午 2:36 
For whatever reason, one-wide characters (such as .,!) don't render with rotated to down or left. Everything else seems to be fine.
AVUMP 2024 年 8 月 12 日 上午 8:06 
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 2024 年 7 月 17 日 下午 12:38 
Damn, exactly what I was looking for! A pure gem... Thank you for sharing :)
BobGrey 2024 年 1 月 9 日 下午 8:16 
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 2024 年 1 月 9 日 下午 8:08 
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 2023 年 5 月 7 日 上午 1:15 
you sir are a god
Shillelagh 2023 年 2 月 11 日 下午 2:48 
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 2023 年 2 月 11 日 下午 12:31 
why would you spend so much time on this and not even let the value change
MarcusTheGamer 2022 年 9 月 3 日 下午 1:46 
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 2022 年 2 月 18 日 上午 9:55 
Best one on the workshop :steamthumbsup:
lexignatov 2022 年 1 月 29 日 上午 4:34 
Great job!
Shillelagh 2021 年 11 月 20 日 下午 8:45 
What don't you get?
Hawkena 2021 年 11 月 20 日 下午 8:39 
i dont get this at all.
Shillelagh 2021 年 11 月 5 日 上午 4:48 
Oh my god, a life saver.
OMNI 2021 年 10 月 21 日 上午 5:45 
I made a font edit if anyone wants to use it.... Basically block numbers and a few letters adjusted.

Font1: 00019209B400AAAA793CA54A555690015244449415500BA00049038000092549F6DE592EE7CEE79EB792F39EF3DEE492F7DEF79E104110490A201C7008A04504

Font2: FFFE57DAD75C7246D6DCF34EF3487256B7DAE92E64D4B75A924EBEDAF6DA56D4D74856B2D75A711CE924B6DEB6A4B6FAB55AB524E54ED24C911264965400000E

puipuix  [作者] 2021 年 8 月 29 日 上午 11:51 
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 2021 年 8 月 28 日 下午 11:25 
what the fudge how did you manage this in less than 700 characters!!!???
puipuix  [作者] 2021 年 8 月 14 日 上午 2:09 
@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 2021 年 8 月 12 日 下午 5:37 
Thank you!

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