Outlined text

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Bonfires Down
Prole
Posts: 3
Joined: Tue Feb 25, 2014 9:41 pm

Outlined text

Post by Bonfires Down »

Hi,

Is there an easy way to draw outlined/stroked text. Any good library?
Cartread
Prole
Posts: 6
Joined: Sat May 19, 2012 8:17 pm

Re: Outlined text

Post by Cartread »

There's a simple outlined font here: https://love2d.org/wiki/Tutorial:Fonts_and_Text
I don't know of a library that outlines.
I haven't seen outlined text in many games (flash has drop shadows of some kind).

I've tried drawing the font black up,down,left and right 1 pixel then drawing color on top (draw 5 times), but this causes a spike in CPU.
Drawing 5 times to ImageData or Canvas could work?
Personally, I ended up making a font .png in photoshop (did the yellow character seperation by hand).
User avatar
veethree
Inner party member
Posts: 877
Joined: Sat Dec 10, 2011 7:18 pm

Re: Outlined text

Post by veethree »

I was gonna try to make outlined text yesterday but kinda gave up.

What I was gonna do is first draw the text to a canvas, then use a shader to blur it, then apply another shader that forces the alpha to 1. Then Draw the normal text over that. I'm pretty sure that would work but I haven't tested it.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests