Stormworks: Build and Rescue

Stormworks: Build and Rescue

64 valoraciones
Compact Resizable Rotatable Custom Font
   
Premio
Favoritos
Favorito
Quitar
Tamaño
Publicado el
Actualizado el
249.220 KB
11 AGO 2021 a las 2:58 p. m.
11 AGO 2021 a las 3:35 p. m.
2 notas sobre cambios ( ver )

Suscríbete para descargar
Compact Resizable Rotatable Custom Font

Descripción
Compact Resizable Rotatable Custom Font
Compact LUA script to draw smaller (3x5 instead of 4x5), resizable, rotatable text.

Don't forget to like if you do :)



The script itself use 628/4096 char and need 2 property text box.

How to use
  1. Copy-Past the 2 property box in your MC.
  2. Copy-Pas everything below "Needed function below".
  3. Call the script with
    dst(x,y,text,size=1,rotation=1,is_monospace=false)
    x,y -> Display coordinates
    text -> Text to draw. (Non supported character will not be drawned.)
    size -> (optional) The font size or size of each pixel. (A size of 2 mean that each character will be 6x10)
    rotation -> (optional) 1-4 for UP RIGHT DOWN LEFT.
    is_monospace -> (optional) If true each character will have the same size.

Notes
  • You can create your own font by saving each character pixel in an hexadecimal code (4 symbol per character with the last bit (when converted to binary) telling if the character is only 1 pixel wide)
Discusiones populares Ver todo (1)
1
21 OCT 2021 a las 7:48 a. m.
Other Fonts
puipuix
23 comentarios
RedPug 26 AGO a las 4:23 p. m. 
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 AGO a las 2:46 p. m. 
it appears that the 1-wide characters are being rendered inside the previous character.
RedPug 26 AGO a las 2:36 p. m. 
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 AGO a las 8:06 a. m. 
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 a las 12:38 p. m. 
Damn, exactly what I was looking for! A pure gem... Thank you for sharing :)
BobGrey 9 ENE a las 8:16 p. m. 
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 ENE a las 8:08 p. m. 
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 a las 1:15 a. m. 
you sir are a god
Shillelagh 11 FEB 2023 a las 2:48 p. m. 
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 a las 12:31 p. m. 
why would you spend so much time on this and not even let the value change