Ooops
November 25, 2020, 08:12:16 AM

Author Topic: [bb] Rounded text by Fernhout [ 1+ years ago ]  (Read 567 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Rounded text by Fernhout [ 1+ years ago ]
« on: June 29, 2017, 12:28:39 AM »
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
  1. ;-----------------------------------------------------------
  2. ; Function RoundText Give a text a differend back color
  3. ; Pass X and Y position and the texts  you want to print.
  4. ; After that i used color names instead of RGB color notation
  5. ; See the function SetColor for mor detail
  6. ;
  7. ; Remark this wil not flip screens and draw on the active viewport
  8. ; setup by the user.
  9. ;-----------------------------------------------------------
  10. Function RoundText (XPos,YPos,Label$,RoundColor$,TextColor$)
  11.         SetColor (RoundColor$) ; New function see function for detail
  12.         For x = -1 To 1
  13.                 For y = -1 To 1
  14.                         Text Xpos+x,Ypos+y,Label$
  15.                 Next
  16.         Next
  17.         SetColor (TextColor$)
  18.         Text XPos,YPos,Label$
  19. End Function


Comments :


Rob Farley(Posted 1+ years ago)

 Just a minor addition to this would be to add a couple of optional parameters
Code: [Select]
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]

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal