Code archives/BlitzPlus Gui/Rounded text

This code has been declared by its author to be Public Domain code.

Download source code

Rounded text by Fernhout2005
If you want to print text and and give it a extra demention, you can use this function. Blitz3D. This print text around the coordinates you provided and the main text on the coordinates is an differend color. Bouth colors are given. Dou you wil get a back and frond color.
;-----------------------------------------------------------
; Function RoundText Give a text a differend back color 
; Pass X and Y position and the texts  you want to print.
; After that i used color names instead of RGB color notation
; See the function SetColor for mor detail
;
; Remark this wil not flip screens and draw on the active viewport
; setup by the user.
;-----------------------------------------------------------
Function RoundText (XPos,YPos,Label$,RoundColor$,TextColor$)
	SetColor (RoundColor$) ; New function see function for detail
	For x = -1 To 1
		For y = -1 To 1
			Text Xpos+x,Ypos+y,Label$
		Next 
	Next 
	SetColor (TextColor$)
	Text XPos,YPos,Label$
End Function

Comments

Rob Farley2005
Just a minor addition to this would be to add a couple of optional parameters
Function RoundText (XPos,YPos,Label$,RoundColor$,TextColor$,xcenter=false,ycenter=false)
..
..
Text Xpos+x,Ypos+y,Label$,xcenter,ycenter
Gives you the option to centre it like standard text commands.


Fernhout2005
I am a beginner in programming. So this was a nice test for me te see if i understand Blits. Maybe not everything is as neet as possible. ITs a good idea you give me. thanks.


Code Archives Forum