{"id":5,"date":"2010-11-11T11:04:44","date_gmt":"2010-11-11T11:04:44","guid":{"rendered":"http:\/\/www.albertosarullo.com\/blog\/?p=5"},"modified":"2010-12-01T15:55:37","modified_gmt":"2010-12-01T15:55:37","slug":"html5-canvas-display-list","status":"publish","type":"post","link":"http:\/\/www.albertosarullo.com\/blog\/html5-canvas-display-list","title":{"rendered":"Html5 Canvas Display List"},"content":{"rendered":"<p>Html5 Canvas is a cool component, but:<\/p>\n<ul>\n<li>without a Display List many developers loose their time to draw simple geometric polygons<\/li>\n<li>without interaction, polygons are motionless and dead<\/li>\n<\/ul>\n<p><!--more--><br \/>\nSo, I&#8217;ve began to write a Javascript library to fill this gap.<\/p>\n<p>My idea is to write simple classes to:<\/p>\n<ul>\n<li>wrap obvious polygons attributes<\/li>\n<li>make polygon interactive (dragging, clicking)<\/li>\n<\/ul>\n<h2>Code Snip<\/h2>\n<pre name=\"code\" class=\"javascript\">\r\nvar displayList = new DisplayList(\"canvas\");\r\nvar circle = new Circle(200, 100, 50, draggable);\r\nvar rectangle = new Rectangle(100, 100, 40, 40, draggable);\t\r\n\t\r\ndisplayList.add( rectangle );\r\ndisplayList.add( circle );\r\ndisplayList.render();\t\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Html5 Canvas is a cool component, but: without a Display List many developers loose their time to draw simple geometric polygons without interaction, polygons are motionless and dead<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,9,3],"tags":[50,11,49,4,12],"class_list":["post-5","post","type-post","status-publish","format-standard","hentry","category-canvas","category-html5","category-javascript","tag-canvas","tag-display","tag-html5","tag-javascript-2","tag-list"],"_links":{"self":[{"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/posts\/5","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":0,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.albertosarullo.com\/blog\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}