Page 1 of 1

Canvas Button... Help?

PostPosted: Sat Dec 05, 2009 2:30 am
by Hblade
I dont get this, I'm trying to make a button using a canvas :/ Here's my code
Code: Select all
//Base color of the button
erase(81, 132, 172, 0);

//Set the color of the border for the top and left sides
setpen(105, 200, 200, 4, 0);

// Make the top and left borders
moveto(4, 4);
lineto(width-1, 4);
moveto(4, 4);
lineto(4, height-1);


//Set the color of the border for the botom and right sides
setpen(49, 100, 100, 4, 0);

//Make the botom and right borders
moveto(0, height-1);
lineto(width-1, height-1);
lineto(width-1, 0);





But instead of making a lighter colored border it looks like this:
button.png
button.png (636 Bytes) Viewed 437 times

Re: Canvas Button... Help?

PostPosted: Sat Dec 05, 2009 3:13 am
by GeoGia
Hello :)

I haven't had a chance to use canvases yet, but a look at the script reference shows the arguments for setpen like this:

void setpen(int r, int g, int b, double transp, int pensize)

And transparency should be between 0 and 1. I think that probably has something to do with it

Re: Canvas Button... Help?

PostPosted: Sun Dec 06, 2009 1:27 pm
by Hblade
lol.. I had the transparency and the size locations mixed up...