November 28, 2020, 11:48:21 AM

Author Topic: [bb] Shadow Text by Grey Alien [ 1+ years ago ]  (Read 412 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Shadow Text by Grey Alien [ 1+ years ago ]
« on: June 29, 2017, 12:28:41 AM »
Title : Shadow Text
Author : Grey Alien
Posted : 1+ years ago

Description : Set the Colour outside of the function then call it.  It will call the text command twice, once for a black shadow and then once for the colour version on top.

Also try the code that draws a grey rectangle with shadow underneath.


Code :
Code: BlitzBasic
  1. ; -----------------------------------------------------------------------------
  2. ; ccShadowText
  3. ; -----------------------------------------------------------------------------
  4. Function ccShadowText(x%, y%, TheText$, Centre)
  5.         ;make a black shadow in the same font behind the text so it shows up on top of images
  6.         Local ShadowTextDepth% = 1
  7.  
  8.         ;first store the current color
  9.         red = ColorRed()
  10.         green = ColorGreen()
  11.         blue = ColorBlue()
  12.        
  13.         Color 0,0,0
  14.         Text x + ShadowTextDepth, y + ShadowTextDepth, TheText, Centre
  15.         Color red, green, blue
  16.         Text x, y, TheText, Centre     
  17. End Function
  18.  
  19. Function ccShadowRect(x, y, w, h)      
  20.         ;draw a shadow first
  21.         Color 0,0,0
  22.         Rect x+4, y+4, w, h, 1
  23.         ;now a grey rect       
  24.         Color 150,150,150
  25.         Rect x, y, w, h, 1      
  26. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal