Pixelated Fonts

AwesomePassword

  • Posts: 104
So, fonts. If you don't have smoothing on, you can't edit the spacing between the text. This wouldn't be so bad if the character didn't all touch each other. My game is all pixel art, so I require a pixel font. However, take a look at this:

So, is there anyway to space text without smoothing?
~Password
===
Games:
-Tetra Factory - 80%

SaintHeiser

  • Posts: 4
I have a same problem. Fonts have not spaces between letters. How I can fix that? Maybe I can change letterspace parameter in the piece of code? Really Now impossible work with texts because of text is glue.

coleislazy

  • *
  • Posts: 2607
Here is my solution. Import the attached behavior and use the provided global block (you don't have to attach it to a scene to use it) instead of the normal "draw text" block in "when drawing". You set it up as in the screenshot below. It is very important that the "graphics" field is filled with a code block containing the letter "g". This is the graphics object being used and it won't work if it isn't exactly as shown! "Font" and "color" are self explanatory, and "spacing" is how many pixels should be between each character.

SaintHeiser

  • Posts: 4
Oh, it works! Really thanks!
I think, that very important to write this method into stencylpedia. Because of I tryed to find the solution very long, before I asked my problem here.

AwesomePassword

  • Posts: 104
Here is my solution. Import the attached behavior and use the provided global block (you don't have to attach it to a scene to use it) instead of the normal "draw text" block in "when drawing". You set it up as in the screenshot below. It is very important that the "graphics" field is filled with a code block containing the letter "g". This is the graphics object being used and it won't work if it isn't exactly as shown! "Font" and "color" are self explanatory, and "spacing" is how many pixels should be between each character.
Um...how does this work again?  :-[
I kinda don't know how to create custom blocks and whatnot; can you upload it on stencylforge? That'd be great!
~Password
===
Games:
-Tetra Factory - 80%

coleislazy

  • *
  • Posts: 2607
The file you need is attached to my post. Just download the "GLOBAL Draw Text.png" file and import it into Stencyl (the image has the behavior code embedded in it), then set it up like I have in the other screenshot.

Bombini

  • *
  • Posts: 1390
Hey there,

i know its a super old post but still an important topic.
Its still not clear to me how i import the PNG.
As an actor? I wont get the block.
As code? wont work.

Cheers!

SadiQ

  • Posts: 1795
Download the above PNG file. Open the game where you want to use it and go to File ->Import Resource.
Stencyl will automatically open the behavior. You can close it without doing anything to it.
Open the behavior where you want to draw your text and look into the CUSTOM field. You'll find the block there.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Bombini

  • *
  • Posts: 1390

purplelava

  • Posts: 82
coleislazy, I get the following errors when trying to use your block. Know how to fix this? It doesn't seem to see the variables.



GLOBAL Draw Text: Type not found : Number
   from scripts.Design_4_4_GLOBALDrawText
   line: 81
   columns: 2-35
GLOBAL Draw Text: Type not found : Number
   from scripts.Design_4_4_GLOBALDrawText
   line: 82
   columns: 2-27
GLOBAL Draw Text: Int should be String
   from scripts.Design_4_4_GLOBALDrawText
   line: 85
   columns: 7-60

yoplalala

  • *
  • Posts: 1611
you could try the drawing extensio if you wan only the spacing http://community.stencyl.com/index.php/topic,35352.0.html