Today, You are going to see the power of HTML5 and Javascript and I’m going to show you, step by step, how to create the Great DrawSomething application in Javascript.
DrawSomething JS

Ready?!?! so lets go.
The first thing we’re going to learn is how to draw inside your browser:
HTML5 has a new element called Canvas, to add a canvas inside your html, you just need to copy this code inside the html page:
<canvas id=”board” class=”board” ></canvas>
To draw inside this canvas with the mouse, we need to listen to three mouse events:

Ready?!?! so lets go.
The first thing we’re going to learn is how to draw inside your browser:
HTML5 has a new element called Canvas, to add a canvas inside your html, you just need to copy this code inside the html page:
<canvas id=”board” class=”board” ></canvas>
To draw inside this canvas with the mouse, we need to listen to three mouse events:
- mousedown - to start drawing the line
- mousemove - to continue drawing the line
- mouseup - to stop drawing the line
var board = document.getElementById(“board”);
board.addEventListener(“mousedown”,startPaintWithMouse,false);
board.addEventListener(“mousemove”,movePaintWithMouse,false);
board.addEventListener(“mouseup”,stopPaintWithMouseUp,false);
Here are the methods implementation:
Now, just add the buttons that change the line width and color and start to draw inside the html5 canvas element.
In the next post, We will learn how to record the user movements and to play it, just like the DrawSomething app.
var startPaintWithMouse = function(event) {
brushCtx = board.getContext(‘2d’); // get the context of the canvas
brushCtx.beginPath();
brushCtx.lineWidth = lineWidth; // set line width from variable
brushCtx.strokeStyle = color; // set line color from variable
brushCtx.moveTo(event.offsetX,event.offsetY); // start drawing from this point
};
var movePaintWithMouse = function(event) {
if (mouseState == 1) {
event.preventDefault();
brushCtx = board.getContext(‘2d’);
brushCtx.lineTo(event.offsetX,event.offsetY); // go to this point and draw
brushCtx.stroke(); // stroke the line
}
};
var stopPaintWithMouseUp = function(evet) {
mouseState = 0; // set mouse state to 0 to stop the draw
};
Now, just add the buttons that change the line width and color and start to draw inside the html5 canvas element.
In the next post, We will learn how to record the user movements and to play it, just like the DrawSomething app.
That is a good thing. I hope I could use it freely, nevertheless, its modifications are too complicated to me.
ReplyDeleteGreat Article
DeleteIEEE Final Year Projects for CSE
IEEE Project Centers in Chennai
Each element is important in this structure of the code. We need to draw the clean lines to create the desired application.
ReplyDeleteHi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or learn thru JavaScript Online Training India. Nowadays JavaScript has tons of job opportunities on various vertical industry. JavaScript Training in Chennai
ReplyDeleteBest top 10 digital marketing companies Tirupati
ReplyDeleteGreat Information, Thanks for sharing
Best igital marketing agencies in Anantapur
ReplyDeletehelpful information, thanks for writing and share this information
Best Digital Marketing Agency
ReplyDeleteGreat Information, Thanks for sharing
I learn from a good blog, your blog I have a great inspiration, thank you. Send Gifts To Pakistan
ReplyDeletea pride for me to be able to discuss on a quality website because I just learned to make an article on
ReplyDeletecara menggugurkan kandungan
I would like to learn how to record the user movements and to play this game. It must be exciting!
ReplyDeleteNeeded to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
ReplyDeleteaws training in chennai
advanced aws training in chennai
AWS Training in Bangalore - Live Online & Classroom
ReplyDeletemyTectra Amazon Web Services (AWS) certification training helps you to gain real time hands on experience on AWS. myTectra offers AWS training in Bangalore using classroom and AWS Online Training globally. AWS Training at myTectra delivered by the experienced professional who has atleast 4 years of relavent AWS experince and overall 8-15 years of IT experience. myTectra Offers AWS Training since 2013 and retained the positions of Top AWS Training Company in Bangalore and India.
IOT Training in Bangalore - Live Online & Classroom
IOT Training course observes iot as the platform for networking of different devices on the internet and their inter related communication. Reading data through the sensors and processing it with applications sitting in the cloud and thereafter passing the processed data to generate different kind of output is the motive of the complete curricula. Students are made to understand the type of input devices and communications among the devices in a wireless media.
Vest Nice blog for learning new things,thanks for such beautiful blog.
ReplyDeletebelow some new idea plz check once.
kajal agarwal hot
Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
ReplyDeleteAdvanced AWS Training in Bangalore | Best Amazon Web Services Training Institute in Bangalore
Advanced AWS Training Institute in Pune | Best Amazon Web Services Training Institute in Pune
Advanced AWS Online Training Institute in india | Best Online AWS Certification Course in india
AWS training in bangalore | Best aws training in bangalore
Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
ReplyDeletemicrosoft azure training in bangalore
rpa training in bangalore
rpa training in pune
best rpa training in bangalore
Great thoughts you got there, believe I may possibly try just some of it throughout my daily life.
ReplyDeleteBest Devops training in sholinganallur
Devops training in velachery
Devops training in annanagar
Devops training in tambaram
This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.
ReplyDeletepython Course in Pune
python Course institute in Chennai
python Training institute in Bangalore
good post
ReplyDeletebrittanya razavi
The post was really very good.Thanks for sharing
ReplyDeleteprestige elysian
It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.
ReplyDeleteAdvanced Python Training Institute in Chennai| Best Python Training institute in Chennai
Advanced RPA Training in Chennai | Best RPA Training institute in Chennai
Advanced DevOps Training in Chennai | Best DevOps Training institute in Chennai
Advanced Azure Training in Chennai | Best Azure Training institute in Chennai
Advanced Java Training in Chennai | Best Java Training institute in Chennai
Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
ReplyDeletepython training in bangalore
thanks for sharing this information
ReplyDeletetableau training in bangalore
tableau training in bangalore btm
best tableau training institutes in bangalore
tableau classroom training in bangalore
python training in bangalore
best python training institute in bangalore
python training in jayanagar bangalore
python training in btm Layout
cool stuff you have and you keep Python training in pune overhaul every one of us
ReplyDeleteHey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
ReplyDeleteC Matlab Training in Chennai | Matlab Training in Chennai
Top Dotnet Training in Chennai | Dotnet Training in Chennai
Top Android Training in Chennai | Android Training in Chennai
Top CCNA Training in Chennai | CCNA Training in Chennai
Send Gifts Under $10 , Send Gifts to Pakistan , Send Corporate Gifts
ReplyDeleteIf you are looking for gift delivery in Pakistan? We warmly welcome you to https://www.thewoodvalue.com/ Because we offer you one of the best wooden handmade art & craft decor items to send gifts Pakistan. A variety of Pakistan handicrafts, home decor, office decor, kitchen decor and wall decor are available at our online store. We offer online gift shopping in Pakistan with free delivery. The Wood Value is great way to send wooden handmade gifts as corporate gifts.
I’ve found extensive lists before, but none this informative. Thanks for sharing!
ReplyDeleteFor more details Click Here- SAP Training in Bangalore
Attend The Data Science Course From ExcelR. Practical Data Science Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Science Course.
ReplyDeleteData Science Course
Great! I like it. fiver logo online design
ReplyDeletenice....!
ReplyDeletedominican republic web hosting
iran hosting
palestinian territory web hosting
panama web hosting
syria hosting
services hosting
afghanistan shared web hosting
andorra web hosting
belarus web hosting
nice blogsss....
ReplyDeletebrunei darussalam hosting
inplant training in chennai
ReplyDeleteYou write this post very carefully I think, which is easily understandable to me. Not only this, but another post is also good. As a newbie, this info is really helpful for me. Thanks to you.
Tally ERP 9 Training
tally classes
Tally Training institute in Chennai
Tally course in Chennai
ReplyDeleteThis content of information has
helped me a lot. It is very well explained and easy to understand.
seo training classes
seo training course
seo training institute in chennai
seo training institutes
seo courses in chennai
seo institutes in chennai
seo classes in chennai
seo training center in chennai
Such a wonderful article and I feel that it is best to write more on this topic. Thank you so much because i learn a lot of ideas about it. Keep posting...
ReplyDeleteDigital Marketing Course In Kolkata
Web Design Course In Kolkata
SEO Course In Kolkata
Thanks For Sharing. Keep Posting
ReplyDeletebest React JS Training course in Bangalore
Blockchain training in Bangalore
python certification training in Bangalore
This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
ReplyDeleteCorrelation vs Covariance
I finally found great post here.I will get back here. I just added your blog to my bookmark sites. thanks.Quality posts is the crucial to invite the visitors to visit the web page, that's what this web page is providing.
ReplyDeleteData Science Course
It has fully emerged to crown Singapore's southern shores and undoubtedly placed her on the global map of residential landmarks. I still scored the more points than I ever have in a season for GS. I think you would be hard pressed to find somebody with the same consistency I have had over the years so I am happy with that.
ReplyDeleteData Science Training
Thank you to the perform as well as discuss anything incredibly important in my opinion
ReplyDeleteAWS training in chennai | AWS training in annanagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery
This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
ReplyDeleteWeb Designing Training Course in Chennai | Certification | Online Training Course | Web Designing Training Course in Bangalore | Certification | Online Training Course | Web Designing Training Course in Hyderabad | Certification | Online Training Course | Web Designing Training Course in Coimbatore | Certification | Online Training Course | Web Designing Training Course in Online | Certification | Online Training Course
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
ReplyDeletedata science interview questions
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
ReplyDeleteSimple Linear Regression
Correlation vs covariance
KNN Algorithm
Logistic Regression explained
Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad
ReplyDeleteVery nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data scientist courses
ReplyDeleteAmazing Article,Really useful information to all So, I hope you will share more information to be check and share here.
ReplyDeleteinplant training for biotechnology in chennai
inplant training for ece students
inplant training mechanical engineering students
inplant training certificate format for civil engineering
inplant training report ppt
inplant training report samples
inplant training letter format
inplant training report for civil engineering pdf
inplant training report for electrical engineering
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.Best data science courses in hyerabad
ReplyDeleteHelp full post, lots of information
ReplyDeletezoho aptitude questions
zoho aptitude questions 2019 pdf
zoho c aptitude questions with answers
c aptitude questions for zoho
zoho aptitude questions with answers
zoho c aptitude questions with answers pdf
zoho aptitude questions 2017 pdf
zoho digital marketing aptitude questions
zoho aptitude questions 2018 pdf
zoho technical support aptitude questions
Amazing Article, Really useful information to all So, I hope you will share more information to be check and share here.
ReplyDeletePygame Tutorial
Pygame Download
Pygame Install
Matplotlib Python
Matplotlib Tutorial
Matplotlib install
PouchDB Tutorial
What is PouchDB
PouchDB Installation
pouchdb server
Super article
ReplyDeleteWhat is Cyber Security
Types of Cyber Attacks
Types of Cyber Attackers
Cyber Security Technology
Cyber Security Tools
Cyber Security Standards
What is Google Adwords
Google Adwords tutorial
Google Keyword Planner
How to Advertise on Google
Great information, nice to read your blog. Keep updating.
ReplyDeletepositive effects of social media
applications of artificial intelligence
ai applications
what is php used for in web design
rpa uipath jobs
php developer interview questions