Canvas graphic effects

Non-platform specific questions.

Canvas graphic effects

Postby sportmaster » Sat Dec 04, 2010 2:00 pm

Anybody wants a point from me :) ? so please tell me how to display something like this :
Attachments
gradient_bar.png
gradient_bar.png (4.47 KiB) Viewed 724 times
User avatar
sportmaster
 
Posts: 32
Joined: Thu Jun 25, 2009 8:29 pm
Score: 0 Give a positive score

Re: Canvas graphic effects

Postby lcl » Sat Dec 04, 2010 2:51 pm

For example you can do that:

Place this code to canvas actor's create actor code:
Code: Select all
int i; //set variables
int j;
int counter;

erase(0, 0, 0, 1);

for (i = 0; i < 85; i ++) //from dark to light
{
    setpen(0, i * 3, 0, 0, 1); //Set color
    moveto(0, i);
    lineto(width, i);
}
for (j = 85; j > 1; j --) //from light to dark
{
    counter ++;
    setpen(0, j * 3, 0, 0, 1); //set color
    moveto(0, counter + 84);
    lineto(width, counter + 84);
}

:D Did that help you? :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Canvas graphic effects

Postby sportmaster » Sat Dec 04, 2010 3:52 pm

That is exactly what I needed :D I'm really happy :D That's what I like, a quick and perfect help with explanations in the code. You absolutely should earn a point from me so there it is: click ! :D
User avatar
sportmaster
 
Posts: 32
Joined: Thu Jun 25, 2009 8:29 pm
Score: 0 Give a positive score

Re: Canvas graphic effects

Postby lcl » Sat Dec 04, 2010 5:23 pm

Thanks! Glad it helped! :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest