-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|392|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Text and GUI's


 
HoboBen
Created : 13 September 2006
Edited : 13 September 2006
Language : Blitz

Bordered Text

Display a black border around your text

If you've got a HUD in your game or application, you may just be using plain text to display information. Eventually, I suppose you'll be switching to a bitmap image font, but until then it's the slow and evil



Yes? But what if the background colour of the game or application turns to the same colour as the text? This will make it hard to read, won't it? Plus, the standard Text function looks ugly. I do, however, have an alternative method, which coded eons ago, and probably has been done before eons before that too. It's been a really popular peice of code, surprisingly. Ready? The classic bordered text function. Here it is...



Basically, you just call



Just like you called the standard text function.

Whatever font or colour you've used, this function will display the text with a black border and it will also keep the colour the same as what it was set to before you called it. Great, isn't it?

Please note, however, that the Text function (Which is called 9 times per txt function!) is slow, and bitmap images are much better. Juicy Fonts is a great bitmap font creation tool.

 

Comments