Ooops
March 05, 2021, 07:56:50 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Like stats
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Draw gradiented surface! by ChrML [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Draw gradiented surface! by ChrML [ 1+ years ago ] (Read 416 times)
BlitzBot
Jr. Member
Posts: 1
Total likes: 0
[bb] Draw gradiented surface! by ChrML [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:42 AM »
Title :
Draw gradiented surface!
Author :
ChrML
Posted :
1+ years ago
Description :
I sat today for 10 mins, and made a little function which lets you draw gradiented surfaces out of lines. This method is a lot faster than with WritePixelFast. It can gradiate between any colors!
Code :
Code: BlitzBasic
Function
DrawGradientSurface
(
sred#,sgreen#,sblue#,dred#,dgreen#,dblue#,x%,y%,width#,height#
)
eachxred#=
(
dred#-sred#
)
/width#
eachxgreen#=
(
dgreen#-sgreen#
)
/width#
eachxblue#=
(
dblue#-sblue#
)
/width#
tempwidth%=width#
For
tempx=x%
To
x%+tempwidth%
colr = eachxred#*count+sred
colg = eachxgreen#*count+sgreen
colb = eachxblue#*count+sblue
Color
colr,colg,colb
Line
tempx,y%,tempx,y%+height#
count=count+
1
Next
End Function
Comments :
none...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Draw gradiented surface! by ChrML [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal