ALL
How to draw pentagram in HTML5 canvas
I wrote simple function to this magical symbol I like so much:123456789101112131415161718192021222324252627282930<!doctype html><html><body> <canvas id="c" width="500" height="500"></canvas> <script> var ctx = (document.getElementById("c")).getContext("2d"); // draws rotated pentagram with or without cirlefunction pentagram( ctx, x, y, radius, rotate, circle ){ ctx.beginPath(); for ( var i = 0; i <= 4 * Math.PI; i += ( 4 * Math.PI ) / 5 ) { &nb...
Going Fullscreen with Canvas
As notes in the Release Notes, Firefox Aurora introduced the Fullscreen API. This means that it will appear in the release version of Firefox in about 3 months.This is one of several features that will be fantastic for games on the web. Other exciting APIs are theGamepad, Canvas, and Audio. Some of these APIs still need work to be suitable for real-time games, but it’s a great time to be involved in building games for the web.I wanted to try out the Fullscreen API so I built this demo. This should work in both Firefox and Chrome. Try it out:Go FullscreenView the sour...
3,421 0 HTML5 CANVAS FULL SCREEN 2D DRAWING