Canvas Button... Help?

Non-platform specific questions.

Canvas Button... Help?

Postby Hblade » Sat Dec 05, 2009 2:30 am

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 438 times
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Canvas Button... Help?

Postby GeoGia » Sat Dec 05, 2009 3:13 am

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
You don't know what you can do unless you've already done it
GeoGia
 
Posts: 19
Joined: Wed Nov 04, 2009 1:30 am
Score: 2 Give a positive score

Re: Canvas Button... Help?

Postby Hblade » Sun Dec 06, 2009 1:27 pm

lol.. I had the transparency and the size locations mixed up...
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron