[help] JS/canvas button

01/20/2013 19:09 Hikarim#1
Hi,
i would like to ask for some help, i am trying to make a Button using canvas and JavaScript, but i cant get rounded corners... i googled but didnt find anything that could help me out... so im turning myself on you guys :)

here's what i got now:

Code:
function drawCanvas1() {
var gradientCanvas = document.getElementById('gradientCanvas');
var context = gradientCanvas.getContext('2d');
var myGradient = context.createLinearGradient(0, 60, 0, 0);
myGradient.addColorStop(0, 'blue');
myGradient.addColorStop(1, 'white');
context.fillStyle = myGradient;
context.fillRect(0, 0, 170, 50);
//text drawing..
context.fillStyle    = 'white';
context.textBaseline = 'top';
context.font         = 'bold 30px sans-serif';
context.fillText('Download', 10, 10);
	

}
01/20/2013 20:40 PseudoPsycho#2
Well, you've got 2 possbilties:
1.) You can load the figure from an image
or 2.) You can take a lot of squares to build something that looks like it.
I don't know any method to do so on an easier way...
01/20/2013 21:28 Muddy Waters#3
Why do you just assume that someone creating a thread in English speaks German? Seriously, that is just lame... :rolleyes:

Back to topic:
I never really used canvas to be honest, but unlike you I was able to find some blog entry via Google that looks promising at a first glance. You might want to look into it, here you go: [Only registered and activated users can see links. Click Here To Register...]