sign in

 



Forgot your password?

signup

Why sign up?
- One account for five websites!
- Free access to Premium Codes
- Acess to cool web tools
- Ask and answer questions
- Stay ahead of other web developers
- and MUCH MORE!




You can also sign up by your facebook account!
Feel The Power

Html Codes: Canvas- Make Graphical Buttons by a Function

When HTML5 Canvas element is used, there is no way to define HTML standard form elements; so if you need a button you can not create it easily. The following code is a function for creating buttons inside HTML5 Canvas element. You can set filling Style of the button when the mouse cursor comes in, goes out and when the button is pressed. It is also possible to define button text, its font style and color. If the text is bigger than the button width, it is automatically adjusted. If you fill that simple colors are boring, no problem, define a gradient and put it as the button color. A function name and its arguments can passed into the button creation function; so when the button is pressed, it will get ran. You can easily add different features to the function below, but if you are a beginner, leave the function definition codes and just learn how to use it. Enjoy!



If you don't know how to use this code or need more information Click here!



 

You can leave comments once you sign in/up.




Review

Please Rate this!
VISITORS
Online Users: 13
Total Online Users: 17
Recent Members: kogweno, pakman5k, uyennhinuts, sahab ali, Gracie
FIND US

LINK US

Link to us:

Please put this code in your page.