Question: is it possible to explain LICE_GradRect(...) a little bit? thanks
Asked by gio (94.66.27.x) on January 31 2013, 1:17pm
Reply on January 31 2013, 4:15pm:Sure. LICE_GradRect lets you draw gradients.
void LICE_GradRect(LICE_IBitmap *dest, int dstx, int dsty, int dstw, int dsth,
float ir, float ig, float ib, float ia,
float drdx, float dgdx, float dbdx, float dadx,
float drdy, float dgdy, float dbdy, float dady,
int mode);
dstx-dsth: position/size of rectangle
ir-ia: RGBA values [0..1] at top left
drdx-dadx: RGBA deltas (per pixel) moving towards right.
drdy-dady: RGBA deltas (per pixel) moving towards bottom.
So, for example:
LICE_GradRect(framebuffer,0,0,100,100,
0,0,0,1.0,
1.0 * 0.01,0.5 * 0.01,0.0 * 0.01,0.0,
0.0 * 0.01,0.5 * 0.01,1.0 * 0.01,0.0, LICE_BLIT_MODE_COPY);
This will make a 100px square, which is black at the top left, orange (full red, half green) top right, blueish on the bottom left (full blue, half green), and white in the bottom right. The 0.01 multipliers on the deltas reflects the size of the rectangle (1.0/100.0).
Comment: