The elm that pixelmanipulator will fill the screen with upon initialization,
and what elements should return to when they are "dead". Default value is
0, an element with the color #000F
If you update this, be sure to update renderers.Renderer.defaultRenderAs in PixelManipulator.renderer
Readonly
elementsA low-level listing of the availiable elements.
Format is much like the argument to PixelManipulator.addMultipleElements, but is not sanitized.
A List of Uint32Arrays each the length of width times height of the canvas. Frame 0 is the new frame, frame one is the prior, etc. Each item holds the element id of each element on screen, from left to right, top to bottom.
This is the number that indicates what animation frame the iterate function is being called with.
You can use this to mannually stop the iterations like so:
cancelAnimationFrame(this.loopint)
(not reccommended)
A string indicating weather it is currently animating or not.
It is "playing"
if it is currently animating, or "paused"
if not
currently animating.
This has been around since early version 0, and once was the innerText
value of a pause/play button!
A mapping from old names for elements to new names for elements.
Allows a user to modify the name of an element at runtime.
Called after PixelManipulator.iterate does its work.
Gets called after a call to PixelManipulator.modifyElement. The ID is passed as the only argument.
The element that was modified.
Called before PixelManipulator.iterate does its work.
false to postposne iteration.
Number of pixels per element in the last frame
An instanace of the object that shows the state to the user.
Add an element with the given element data
The details about the element.
The generated PixelManipulator.elements index
Adds multiple elements.
Index is the element name, value is the element data (and does not require the name). Value is passed to PixelManipulator.addElement
The old ElementData.name
The new ElementData.name
Adds the name to PixelManipulator.nameAliases, and ensures no alias loops are present.
Where to confirm the element
The elm you expect it to be
Does the cell at loc
match ident
?
The Area to search within
A bitfield of what states a pixel should live or die on.
The element to search for
The state that the bitfied says this pixel should be in the next frame.
Locations to look at.
Locations to mark as a true bit.
number as a bitfied array, in order of the items in area, from left to right.
That means that (fundamentalStatesWithin([loc], search) & 1) === boolToNumber(confirmElm(loc, search))
You may want to see this page for more details on how this might be used.
PixelManipulator.fundamentalNewState for higher-level tool
Name of the (possibly aliased) element.
The element from PixelManipulator.elements, respecting aliases in PixelManipulator.nameAliases, or undefined if not found.
Location of the pixel
the element id at a given location
A single frame of animation. Media functions pass this into requestAnimationFrame.
Be careful! Calling this while PixelManipulator.mode is "playing"
might cause two concurrent calls to this function. If any of your automata
have "hidden state" - that is they don't represent every detail about
themselves as data within the pixels - it might cause conflicts.
How to identify what element to modify.
Values to apply to the pre-existing element.
Automatically calls PixelManipulator.aliasElements if
ElementDataUnknown.name is present in data
location of the center of the moore area
Number of matching elements in moore radius
pause canvas iterations
Sets PixelManipulator.mode to "paused"
and cancels the animation frame
referenced in PixelManipulator.loopint
Start iterations on all of the elements on the canvas.
Sets PixelManipulator.mode to "playing"
, and requests a new animation
frame, saving it in PixelManipulator.loopint.
Optional
canvasSizes: CanvasSizesIf PixelManipulator.mode is already "playing"
then
canvasSizes is passed to PixelManipulator.reset. Otherwise reset is not
called.
Reset, resize and initialize the canvas(es). Calls PixelManipulator.pause then PixelManipulator.update. Resets all internal state, excluding the element definitions.
Optional
canvasSizes: CanvasSizesAllows one to change the size of the canvases during the reset.
Set a pixel in a given location.
Value to identify the element.
Calculate the total number of elements within an area
The locations to total up.
The element to look for
The total
Applies any changes made with renderers.Renderer.renderPixel on PixelManipulator.renderer to the canvas
Location of the element.
Name of element at passed-in location. See ElementData.name
"Current" pixel location. (Defaults renderers.Location.loop to false)
element to look for
Number used as bit area to indicate occupied cells
PixelManipulator.fundamentalStatesWithin for lower-level tool
Counter tool used in slower wolfram algorithim.
"Current" pixel location
element to look for
Number of elements in wolfram radius
Replaced with PixelManipulator.wolframNearby for use in faster algorithms
The pixel to change. (Defaults renderers.Location.loop to false)
A bitfield of what states a pixel should live or die on.
The element to search for
The state that the bitfied says this pixel should be in the next frame.
PixelManipulator.fundamentalNewState for more general tool.
A cellular automata engine