Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 04:33

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[help] JS/canvas button

Discussion on [help] JS/canvas button within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2012
Posts: 372
Received Thanks: 21
[help] JS/canvas button

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);
	

}
Hikarim is offline  
Old 01/20/2013, 20:40   #2
 
PseudoPsycho's Avatar
 
elite*gold: 1715
Join Date: Dec 2011
Posts: 672
Received Thanks: 207
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...
PseudoPsycho is offline  
Old 01/20/2013, 21:28   #3
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
Why do you just assume that someone creating a thread in English speaks German? Seriously, that is just lame...

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:
Muddy Waters is offline  
Reply


Similar Threads Similar Threads
Halloween Index Design Mystic's Canvas
12/10/2011 - Metin2 PServer Guides & Strategies - 4 Replies
http://mystic.design.tl/indexdesigns/yilbasi/arka. png http://virustotal.hispasecsistemas.netdna-cdn.com /img/VirusTotal-logo.png DEMO Yilbasi Design by Mystic09 DOWNLOAD
Item-Shop Lager Button Zum Normalen lager button machen? DE
01/12/2011 - Metin2 - 6 Replies
Moin, seid heute gib es ja im inventar den IS button wo man mit sein lager öffnen kann,könnte man den auch zu einem Normalen lager Button Machen?
WarRock statt KOREANISCHE BUTTON --> Englische BUTTON
02/26/2010 - WarRock - 6 Replies
Bin mir nicht sicher ob es diesen Thread schon gibt aber hab bis jetzt nichts gesehen hier. Funktionen Für WarRock Korea Koreanische Schriften (Button) weg und englische Schriften (Button) hin Anleitung
GUI Button
03/22/2009 - Metin2 - 3 Replies
Geht es? - Das der Button in einer GUI immer aktiv ist? Normal - wird ein Button bestätigt wird die Aktion ausgeführt. Jetzt möchte ich aber auch wenn schon etwas ausgeführt wird einen weiteren Button betätigen um eine andere Aktion ausführen zu können. Kann man das nicht irgendwie "umschreiben"?



All times are GMT +1. The time now is 04:33.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.