[bb] Rounded text by Fernhout [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:39

Previous topic - Next topic

BlitzBot

Title : Rounded text
Author : Fernhout
Posted : 1+ years ago

Description : 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.

Code :
Code (blitzbasic) Select
;-----------------------------------------------------------
; 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 Farley(Posted 1+ years ago)

 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.


Fernhout(Posted 1+ years ago)

 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. [/i]