Package : com.danehansen.display Class : public class Glitch Inheritance : Glitch > Object Subclasses : AutoGlitch
Instances of this class will take the image or element (with background image), and in real time glitch out the bytes of the image. No matter if the image is .jpg, .png, or .gif, it will by glitched like a .jpg becuase that is what looks the coolest. This effect will not work locally unless you set up a local server. Otherwise the canvas thinks it’s all tainted and craps out. Also, if you pull in an image from a different server, it will taint the canvas unless you make it think it’s coming from it’s own server, via a fpassthru or readfile (included) or some other serverside trickery.
Public Properties
element : Element
[Read-only] DOM Element manipulated.
Public Methods
Glitch(element:Element)
Creates a Glitch object, using a provided image element or other element with a background-image applied or an object with src, dest, and mirror properties if you want to do a video effect.
fucked(value:int):*
Gets or sets the Glitch’s level of fucked. A low number like 1-3 usually results in a subtle glitching where you can still recognize the image. A higher number such as 50 can more likely distort the image until it is unrecognizable. A value of 0 returns the image to its whole self. Remember that this corruption is actually happening at random, so the results are completely unpredictable. There is a chance that a high fucked amount could still leave an image totally recognizable. Also a chance that a fucked amount of 1 could leave an image completely absent.
start()
Starts a video glitch effect.
stop()
Stops a video glitch effect.
AutoGlitch
Package : com.danehansen.display Class : public class AutoGlitch Inheritance : AutoGlitch > Glitch > Object
Instances of this class will automatically glitch out a random amount for random amounts of times
Public Properties
cleanTime : Number
Maximum duration in milliseconds that the image will remain clean while activated.
glitchTime : Number
Maximum duration in milliseconds that the image will remain glitched while activated.
fuckLimit : uint
Maximum amount of fucked that the image will get while activated.
Public Methods
AutoGlitch(element:Element, cleanTime:Number = 1500, glitchTime:Number = 100, fuckLimit:uint = 5)
Creates an AutoGlitch object, using a provided image element or other element with a background-image applied.
activate()
Activates the instance, starts the glitching timeouts.
deactivate()
Deactivates the instance by killing the timeouts and returning the image to its clean state.
EXAMPLE 1: BASIC GLITCH
var glitch=new Glitch(document.getElementById("basicGlitch"));
EXAMPLE 2: AUTO GLITCH
var autoGlitch=new Glitch(document.getElementById("basicGlitch"));
EXAMPLE 3: GALLERY TRANSITION
var autoGlitch=new Glitch(document.getElementById("basicGlitch"));