GLBasic forum

Feature request => 2D => Topic started by: MrTAToad on 2008-Dec-29

Title: Gradient fill
Post by: MrTAToad on 2008-Dec-29
DBPro has, with its BOX command, the ability to do a gradient fill of colour based on the colour for each corner.   It looks nice and would be worth putting into GLBasic :)
Title: Re: Gradient fill
Post by: Moru on 2008-Dec-29
You mean like this:

Code (glbasic) Select
STARTPOLY 0 // Bitmap = No.0
  POLYVECTOR  0,   0,  0,  0, RGB(255, 255, 255)
  POLYVECTOR   0, 300,  0, 64, RGB (255, 255, 255)
  POLYVECTOR 300, 300, 64, 64, RGB(255, 255, 255)
  POLYVECTOR 250,  50, 64,  0, RGB(  0, 255,   0)
ENDPOLY
Title: Re: Gradient fill
Post by: MrTAToad on 2008-Dec-29
Sounds like the job!
Title: Re: Gradient fill
Post by: Moru on 2008-Dec-29
You can even do it to a bitmap, making it different colors where the lighter areas of the bitmap is.
Title: Re: Gradient fill
Post by: Schranz0r on 2008-Dec-29
Quote from: Moru on 2008-Dec-29
You mean like this:

Code (glbasic) Select
STARTPOLY 0 // Bitmap = No.0
  POLYVECTOR  0,   0,  0,  0, RGB(255, 255, 255)
  POLYVECTOR   0, 300,  0, 64, RGB (255, 255, 255)
  POLYVECTOR 300, 300, 64, 64, RGB(255, 255, 255)
  POLYVECTOR 250,  50, 64,  0, RGB(  0, 255,   0)
ENDPOLY


Yepp, thats a powerfull command :P