November 28, 2020, 01:19:33 PM

Author Topic: [bb] Transparent Background by pexe [ 1+ years ago ]  (Read 619 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] Transparent Background by pexe [ 1+ years ago ]
« on: June 29, 2017, 12:28:38 AM »
Title : Transparent Background
Author : pexe
Posted : 1+ years ago

Description : It's a little slow.. But makes a nice effect..  recommended for your game GUI..

Transparent its not the correct way to call this.. because it works like a sieve..  just writing pixels each 4..


Code :
Code: BlitzBasic
  1. Function TransparentBackground(Start_x%,Start_y%,Width%,Height%,Color_R% = 255,Color_G% = 255,Color_B% = 255)
  2. End_y = Start_y%+Height%
  3. End_x = Start_x%+Width%
  4. WP_Color = (Color_B% Or (Color_G% Shl 8) Or (Color_R% Shl 16) Or ($ff000000))
  5. LockBuffer
  6. For y = Start_y% To End_y-1
  7.         a = Abs(a-1)
  8.         For x = Start_x%+(a*2) To End_x-1 Step 4
  9.                 WritePixelFast x,y,WP_Color
  10.         Next
  11. Next
  12. UnlockBuffer
  13. End Function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal