Glitch
glitch.html
AutoGlitch
glitch.html
Parallax
parallax.html
Sprite
sprite.html
ForwardRewind
sprite.html
ForwardForward
sprite.html
SuperSprite
sprite.html
Preloader
preloader.html
Canvas
Package : com.danehansen.display
Class : public class Canvas
Inheritance : Canvas > Object
A helper class for working with the HTML5 canvas with not that very many shortcuts.
Public Properties
- element : Element
[Read-only] DOM Element manipulated.
Public Methods
- Canvas(element:Element)
Creates a Canvas object, using the provided canvas element. It bases the sizing off the size of the element from its css properties.
- Canvas(width:uint, height:uint)
Creates a Canvas object, using the provided height and width.
- correctArcs()
[static] Overrides the browser’s default arc method with one that looks more correct. Only needed if drawing several arcs/circles that need to align closely. The bug seems to only exist in Chrome currently, and hopefully in time this polyfill will no longer be needed.
- textHeight(family:String, size:*, weight:String = "normal", style:String = "normal", variant:String = "normal"):Number
[static] Calculates the height of a line of text given a family and size and option weight, style and variant.
- textWidth(str:String, family:String, size:*, weight:String = "normal", style:String = "normal", variant:String = "normal"):Number
[static] Calculates the width of a line of text given a family and size and option weight, style and variant.
- measureText(str:String, family:String, size:*, weight:String = "normal", style:String = "normal", variant:String = "normal"):Object
[static] Returns an object with width and height properties reflecting the provided options.
ImageDataReader
Package : com.danehansen.display
Class : public class ImageDataReader
Inheritance : ImageDataReader > Object
Helper class to ease the reading of image data from an image or video.
Public Constants
- WHITE : uint
[static] The highest brightness value a pixel can have.
Public Properties
- data : Array
[Read-only] Array of image data.
Public Methods
- ImageDataReader(src:Element, mirror:Boolean = false)
Creates an ImageDataReader object, using a provided image or video element. Whether the resulting data should be mirrored can also be specified here.
- adjustContrast(reset:Boolean = false)
Adjusts the instance‘s contrast based on the low, high, and average brightness values. When reset is set true, the adjustment is nullified.
- brightness(data:Array, width:uint, height:uint, x:uint, y:uint, mirror:Boolean = false):Number
[static] Returns a brightness value of a specified image data set at a specified x and y coorindate. Whether or not the image is mirrored can aslo be specified here.
- brightness(x:uint, y:uint, fraction:Boolean = false, mirror:Boolean = false):Number
Returns a brightness value at a specified x and y coorindate. By default returns a number between 0-756, but optionally can be returned as a fraction 0-1. Whether or not the image is mirrored can aslo be specified here.
- gather()
Causes the instance to refresh its image data.
- r(x:uint, y:uint):uint
Returns an red value 0-255 at a specified x and y coordinate.
- g(x:uint, y:uint):uint
Returns an greed value 0-255 at a specified x and y coordinate.
- b(x:uint, y:uint):uint
Returns an blue value 0-255 at a specified x and y coordinate.
CharImage
Package : com.danehansen.display
Class : public class CharImage
Inheritance : CharImage > Object
Helper class to convert image data to characters from a set, such as ASCII.
Public Constants
- ASCII : Array
[static] An array representing the ASCII character set.
- CODEPAGE437 : Array
[static] An array representing the Code Page 437 character set.
Public Methods
- CharImage(dest:Element, charSet:Array = CharImage.ASCII, mirror:Boolean = false)
Creates a CharImage object, using a provided element to put the text into. A character set, such as ASCII, can also be provided. Whether the resulting data should be mirrored can also be specified here.
- brightnessToChar(brightness:uint):String
Returns a string representing the correct brightness from the calculated character set.
- dataToString(idr:ImageDataReader, columns:uint, rows:uint):String
Returns an entire depiction of an image data using the character set.