[bb] Transparent Background by pexe [ 1+ years ago ]

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

Previous topic - Next topic

BlitzBot

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) Select
Function TransparentBackground(Start_x%,Start_y%,Width%,Height%,Color_R% = 255,Color_G% = 255,Color_B% = 255)
End_y = Start_y%+Height%
End_x = Start_x%+Width%
WP_Color = (Color_B% Or (Color_G% Shl 8) Or (Color_R% Shl 16) Or ($ff000000))
LockBuffer
For y = Start_y% To End_y-1
a = Abs(a-1)
For x = Start_x%+(a*2) To End_x-1 Step 4
WritePixelFast x,y,WP_Color
Next
Next
UnlockBuffer
End Function


Comments : none...