Monthly Archives: August 2016

A Graphical Inventory for a Video Game in JavaScript

The JavaScript code below implements a inventory session for a video game. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript. Use the arrow keys and the … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

TrueType Fonts in JavaScript with Font-Face

The JavaScript code below, when run, presents an interface that allows the user to specify a font file in TTF format and some text to render in that font. Then, when the button is clicked, the specified text is rendered … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

A Simple HTML Parser in JavaScript

The JavaScript code below, when run, prompts the user to enter some HTML text. When the “Parse” button is clicked, that text will be parsed into an instance of a class named “HTMLDocument”, which contains within it objects corresponding to … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Getting Input from Gamepads with HTML5 and JavaScript

The JavaScript program below, when run, will display the current state of all gamepads connected to the user’s system. To see it in action, copy it into an .html file and open that file in a web browser that runs … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Capturing an Image from a Camera with HTML5 and JavaScript

The JavaScript code below, when run, will display a real-time feed of the user’s default camera, and allow the user to click a button to capture a still image from that camera. To see it in action, copy it into … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

A Pixel Matrix Transceiver in JavaScript

The JavaScript code below implements a rudimentary data transmitter that converts a user-specified string to a series of “frames”, each of which is an image made up of a grid of black and white cells. It then displays those images … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment