{"id":7687,"date":"2014-05-11T05:09:11","date_gmt":"2014-05-10T19:09:11","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=7687"},"modified":"2014-05-11T05:09:11","modified_gmt":"2014-05-10T19:09:11","slug":"htmljavascript-canvas-visual-double-click-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascript-canvas-visual-double-click-tutorial\/","title":{"rendered":"HTML\/Javascript Canvas Visual Double Click Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_visualwithdoubleclick_chalkboard.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML\/Javascript Canvas Visual Double Click Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_visualwithdoubleclick_chalkboard.jpg\" title=\"HTML\/Javascript Canvas Visual Double Click Tutorial\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Canvas Visual Double Click Tutorial<\/p><\/div>\n<p>The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management.<\/p>\n<p>In today&#8217;s tutorial we add to the functionality of the previous <a target=_blank title='HTML\/Javascript Canvas Double Click Tutorial' href='#hjcdct'>HTML\/Javascript Canvas Double Click Tutorial<\/a>, as shown below, where we draw an image on the canvas via drawImage() method, by, today, allowing the user to have additional optional double click functionality (on iOS we say \u201cuse any gesture\u201d) to add some other advice or help prior to the user attempting their answer to the mathematical fractions question posed on the chalkboard (via advice regarding coding logic (thanks) based on <a target=_blank title='[Solved] How to create Event to dynamic canvas? - CodeProject' href='http:\/\/www.codeproject.com\/Questions\/691499\/How-to-create-Event-to-dynamic-canvas'>link<\/a> here).  In addition we offer the visual help by <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1538' title='Google Pie Chart tutorial'>adding<\/a> Google <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/gallery\/piechart' title='Pie Chart information from Google'>Pie Charts<\/a> to visually represent your fractional values (which may aid the user).<\/p>\n<p>You may want to read more at <a target=_blank title='HTML Canvas Reference' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>HTML Canvas Reference<\/a> as a generic reference, or here, at the tutorial <a target=_blank title='javascript - How do I add a simple onClick event handler to a canvas element? - Stack Overflow' href='http:\/\/stackoverflow.com\/questions\/9880279\/how-do-i-add-a-simple-onclick-event-handler-to-a-canvas-element'>javascript &#8211; How do I add a simple onClick event handler to a canvas element? &#8211; Stack Overflow<\/a>.<\/p>\n<p>As you can imagine, this HTML canvas element, new to HTML5, can be very useful for some practical client-side web functionality.<\/p>\n<p>Link to some downloadable HTML programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_visualwithdoubleclick_chalkboard.html_GETME' title='fraction_visualwithdoubleclick_chalkboard.html'>fraction_visualwithdoubleclick_chalkboard.html<\/a><\/p>\n<p>You&#8217;ll notice heavy use of the Javascript <a target=_blank title='Javascript Math.random() information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_random.asp'>Math.random()<\/a> function.<\/p>\n<p>We hope you enjoy this tutorial as a <a target=_blank title='Canvas HTML element live run tutorial'  href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_visualwithdoubleclick_chalkboard.html\">live run<\/a>.<\/p>\n<p>Pretty close to &#8220;almost finally&#8221;, need to thank a great link for coding ideas with this tutorial, here, at this <a target=_blank title='[Solved] How to create Event to dynamic canvas? - CodeProject' href='http:\/\/www.codeproject.com\/Questions\/691499\/How-to-create-Event-to-dynamic-canvas'>link<\/a>.<\/p>\n<p>Pretty close to &#8220;finally&#8221;, have a look at the differences in code that arrived at the comparison part of the extra visual Google Pie Chart &#8220;visual fraction representation&#8221; functionality by examining <a target=_blank title='fraction_somevisual_chalkboard.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_somevisual_chalkboard.html-GETME\">Changes just for Pie Chart Visual Comparisons<\/a> link and the comparison part of all extra double click functionality (on iOS we say \u201cuse any gesture\u201d) by examining <a target=_blank title='fraction_allvisual_chalkboard.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_allvisual_chalkboard.html-GETME\">Changes for all Double Click functionality (on iOS we say \u201cuse any gesture\u201d)<\/a> link.<\/p>\n<p>Yes &#8230; you&#8217;ve reached the end &#8230; hope you have a good time practising your mathematics knowledge of Fractions (there is also post-answer advice (different to optional double click (on iOS we say \u201cuse any gesture\u201d) pre-answer advice and Pie Charts), if you want to learn &#8230; you can get it when you give an incorrect answer)!   Try the double clicking canvas functionality (on iOS we say \u201cuse any gesture\u201d), as well, if you like.<\/p>\n<hr \/>\n<p id='hjcdct'>Previous <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=7591' title='HTML\/Javascript Canvas Double Click Tutorial'>HTML\/Javascript Canvas Double Click Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_withdoubleclick_chalkboard.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML\/Javascript Canvas Double Click Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_withdoubleclick_chalkboard.jpg\" title=\"HTML\/Javascript Canvas Double Click Tutorial\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Canvas Double Click Tutorial<\/p><\/div>\n<p>The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management.<\/p>\n<p>In today&#8217;s tutorial we add to the functionality of the previous <a target=_blank title='HTML\/Javascript Canvas Fractions Game Tutorial' href='#hjcfgt'>HTML\/Javascript Canvas Fractions Game Tutorial<\/a>, as shown below, where we draw an image on the canvas via drawImage() method, by, today, allowing the user to have additional optional double click functionality (on iOS we say \u201cuse any gesture\u201d) to add some other advice or help prior to the user attempting their answer to the mathematical fractions question posed on the chalkboard (via advice regarding coding logic (thanks) based on <a target=_blank title='[Solved] How to create Event to dynamic canvas? - CodeProject' href='http:\/\/www.codeproject.com\/Questions\/691499\/How-to-create-Event-to-dynamic-canvas'>link<\/a> here).<\/p>\n<p>You may want to read more at <a target=_blank title='HTML Canvas Reference' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>HTML Canvas Reference<\/a> as a generic reference, or here, at the tutorial <a target=_blank title='javascript - How do I add a simple onClick event handler to a canvas element? - Stack Overflow' href='http:\/\/stackoverflow.com\/questions\/9880279\/how-do-i-add-a-simple-onclick-event-handler-to-a-canvas-element'>javascript &#8211; How do I add a simple onClick event handler to a canvas element? &#8211; Stack Overflow<\/a>.<\/p>\n<p>As you can imagine, this HTML canvas element, new to HTML5, can be very useful for some practical client-side web functionality.<\/p>\n<p>Link to some downloadable HTML programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_withdoubleclick_chalkboard.html_GETME' title='fraction_withdoubleclick_chalkboard.html'>fraction_withdoubleclick_chalkboard.html<\/a>\n<\/p>\n<p>You&#8217;ll notice heavy use of the Javascript <a target=_blank title='Javascript Math.random() information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_random.asp'>Math.random()<\/a> function.<\/p>\n<p>We hope you enjoy this tutorial as a <a target=_blank title='Canvas HTML element live run tutorial'  href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_withdoubleclick_chalkboard.html\">live run<\/a>.<\/p>\n<p>Almost finally, need to thank a great link for coding ideas with this tutorial, here, at this <a target=_blank title='[Solved] How to create Event to dynamic canvas? - CodeProject' href='http:\/\/www.codeproject.com\/Questions\/691499\/How-to-create-Event-to-dynamic-canvas'>link<\/a>.<\/p>\n<p>Finally, have a look at the differences in code that arrived at this extra canvas double click functionality (on iOS we say \u201cuse any gesture\u201d) by examining <a target=_blank title='fraction_withdoubleclick_chalkboard.html' href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_chalkboard.html-GETME\">fraction_withdoubleclick_chalkboard.html<\/a> link.<\/p>\n<p>Yes &#8230; you&#8217;ve reached the end &#8230; hope you have a good time practising your mathematics knowledge of Fractions (there is also post-answer advice (different to optional double click (on iOS we say \u201cuse any gesture\u201d) pre-answer advice), if you want to learn &#8230; you can get it when you give an incorrect answer)!   Try the double clicking canvas functionality (on iOS we say \u201cuse any gesture\u201d), as well, if you like.<\/p>\n<hr \/>\n<p id='hjcfgt'>Previous <a target=_blank title='HTML\/Javascript Canvas Fractions Game Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=7258'>HTML\/Javascript Canvas Fractions Game Tutorial<\/a> of interest is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_chalkboard.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML\/Javascript Canvas Chalkboard Game Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_chalkboard.jpg\" title=\"HTML\/Javascript Canvas Fractions Game Tutorial\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Canvas Fractions Game Tutorial<\/p><\/div>\n<p>The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management.<\/p>\n<p>In today&#8217;s tutorial we touch on the functionality to draw an image on the canvas via drawImage() method.   In the case of this tutorial that image contributes to the user answering some mathematics questions regarding fractions on a simulated <i>&#8220;chalkboard&#8221;<\/i>.<\/p>\n<p>You may want to read more at <a target=_blank title='HTML Canvas Reference' href='http:\/\/www.w3schools.com\/tags\/ref_canvas.asp'>HTML Canvas Reference<\/a> as a generic reference, or here, at the tutorial <a target=_blank title='javascript - How do I add a simple onClick event handler to a canvas element? - Stack Overflow' href='http:\/\/stackoverflow.com\/questions\/9880279\/how-do-i-add-a-simple-onclick-event-handler-to-a-canvas-element'>javascript &#8211; How do I add a simple onClick event handler to a canvas element? &#8211; Stack Overflow<\/a>.<\/p>\n<p>As you can imagine, this HTML canvas element, new to HTML5, can be very useful for some practical client-side web functionality.<\/p>\n<p>Link to some downloadable HTML programming code &#8230; rename to <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_chalkboard.html_GETME' title='fraction_chalkboard.html'>fraction_chalkboard.html<\/a>\n<\/p>\n<p>You&#8217;ll notice heavy use of the Javascript <a target=_blank title='Javascript Math.random() information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/jsref_random.asp'>Math.random()<\/a> function.<\/p>\n<p>We hope you enjoy this tutorial as a <a target=_blank title='Canvas HTML element live run tutorial'  href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/Canvas\/Game\/Chalkboard\/fraction_chalkboard.html\">live run<\/a>.<\/p>\n<p>Yes &#8230; you&#8217;ve reached the end &#8230; hope you have a good time practising your mathematics knowledge of fractions (there is advice, if you want to learn &#8230; you can get it when you give an incorrect answer)!<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d7258' onclick='var dv=document.getElementById(\"d7258\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=canvas\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d7258' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d7591' onclick='var dv=document.getElementById(\"d7591\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=canvas\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d7591' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d7687' onclick='var dv=document.getElementById(\"d7687\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=mathematics\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d7687' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Canvas HTML element tag can be used as the container to draw graphics on the fly usually via the use of Javascript functions for rendering and event management. In today&#8217;s tutorial we add to the functionality of the previous &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascript-canvas-visual-double-click-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,15,37],"tags":[459,477,513,519,576,652,752,944,997,1319],"class_list":["post-7687","post","type-post","status-publish","format-standard","hentry","category-elearning","category-games","category-tutorials","tag-fractions","tag-games-2","tag-google","tag-google-charts","tag-html","tag-javascript","tag-mathematics","tag-pie-chart","tag-programming","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/7687"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=7687"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/7687\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=7687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=7687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=7687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}