| File | Language | Author(s) | Copyright |
|---|---|---|---|
| boundingBox.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| canvas.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| colorTable.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| colorTools.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| defctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| graphicsState.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| ncsctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| pathDescriptor.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| pixmill.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| resenectab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| textAttributes.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| w3cctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| File | Language | Author(s) | Copyright |
|---|---|---|---|
| boundingBox.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| canvas.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| colorTable.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| colorTools.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| defctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| graphicsState.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| ncsctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| pathDescriptor.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| pixmill.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| resenectab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| textAttributes.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
| w3cctab.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
The PixMill namespace encapsulates all definitions related to the family of PixMill classes.
The PixMill library is a library which handles graphics drawing and layouts to a canvas, which sits on top of a Javascript Canvas object.
PixMill.CTAB_IGNORE → Integer <read-only>
This constant is used to specify that attempts to load duplicate entries into a color table will be ignored.PixMill.CTAB_OVERWRITE → Integer <read-only>
This constant is used to specify that attempts to load duplicate entries into a color table will be overwrite the existing specification.PixMill.CTAB_THROWS → Integer <read-only>
This constant is used to specify that attempts to load duplicate entries into a color table will cause an exception to be thrown.PixMill.DEFCTab → Object <read-only>
This object contains a very simple color table of names and color specifications.PixMill.GRAVITIES → Array<String> <read-only>
This constant contains an array of possible object gravity layout locations as strings.PixMill.LAYOUTS → Array<String> <read-only>
This constant contains an array of possible object layout types as strings.PixMill.NCSCTab → Object <read-only>
This object contains a color table of names and color specifications based on the Natural Color System standard.PixMill.ReseneCTab → Object <read-only>
This object contains a color table of names and color specifications based on colors provided by the Resene company.PixMill.STRETCHES → Array<String> <read-only>
This constant contains an array of possible font stretches as strings.PixMill.STYLES → Array<String> <read-only>
This constant contains an array of possible font styles as strings.PixMill.UNDERLINES → Array<String> <read-only>
This constant contains an array of possible font underlines as strings.PixMill.VARIANTS → Array<String> <read-only>
This constant contains an array of possible font variants as strings.PixMill.W3CCTab → Object <read-only>
This object contains a color table of names and color specifications based on the W3C specification.PixMill.WEIGHTS → Array<String> <read-only>
This constant contains an array of possible font weights as strings.PixMill.colorToGrayRGBCspec(cspec) → String or Array<Number> or Null
This function converts an RGB specification to the nearest neutral tone color using the NTSC formula.PixMill.convertCMYKACspec(type, cspec) → String or Array<Number> or Null ⇏ ArgumentError
This function converts a valid CMYKA color specification into another one of a specified type.PixMill.convertCMYKACspecToCMYKCspec(cspec) → String or Array<Number> or Null
This function converts a valid CMYKA color specification into an CMYK color specification by removing the trailing alpha value.PixMill.convertCMYKCspec(type, cspec) → String or Array<Number> or Null ⇏ ArgumentError
This function converts a valid CMYK color specification into another one of a specified type.PixMill.convertRGBACspec(type, cspec) → String or Array<Number> or Null ⇏ ArgumentError
This function converts a valid RGBA color specification into another one of a specified type.PixMill.convertRGBACspecToRGBCspec(cspec) → String or Array<Number> or Null
This function converts a valid RGBA color specification into an RGB color specification by removing the trailing alpha value.PixMill.convertRGBCspec(type, cspec) → String or Array<Number> or Null ⇏ ArgumentError
This function converts a valid RGB color specification into another one of a specified type.PixMill.extractAlphaFromCMYKACspec(cspec) → String or Number or Null
This function extracts the alpha value from a valid CMYKA color specification. The format of the value depends on the format of the original color specification.PixMill.extractAlphaFromRGBACspec(cspec) → String or Number or Null
This function extracts the alpha value from a valid RGBA color specification. The format of the value depends on the format of the original color specification.PixMill.isGrayRGBCspec(cspec) → Boolean
This function determines if a given RGB color specification is a neutral (gray) color (R=G=B).PixMill.isValidCMYKACspec(cspec) → Boolean
This function determines if a given color specification is a valid CMYKA specification.PixMill.isValidCMYKCspec(cspec) → Boolean
This function determines if a given color specification is a valid CMYK specification.PixMill.isValidRGBACspec(cspec) → Boolean
This function determines if a given color specification is a valid RGBA specification.PixMill.isValidRGBCspec(cspec) → Boolean
This function determines if a given color specification is a valid RGB specification.PixMill.randomGrayRGBCspec(base, range, type) → String or Array<Number> ⇏ ArgumentError
This function creates a random neutral tone (gray) RGB color specification.PixMill.randomRGBCspec(base, range, type) → String or Array<Number> ⇏ ArgumentError
This function creates a random RGB color specification.PixMill.typeOfCMYKACspec(cspec) → String or Null
This function returns the type of the valid color specification as a string (or null, if invalid). Valid string returns are: { 'atstring','integers','floats' }PixMill.typeOfCMYKCspec(cspec) → String or Null
This function returns the type of the valid color specification as a string (or null, if invalid). Valid string returns are: { 'hashstring','integers','floats' }PixMill.typeOfRGBACspec(cspec) → String or Null
This function returns the type of the valid color specification as a string (or null, if invalid). Valid string returns are: { 'atstring','integers','floats' }PixMill.typeOfRGBCspec(cspec) → String or Null
This function returns the type of the valid color specification as a string (or null, if invalid). Valid string returns are: { 'hashstring','integers','floats' }| File | Language | Author(s) | Copyright |
|---|---|---|---|
| boundingBox.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class manages all bounding box operations.
The BoundingBox class is used for graphics object layouts. In essence, it's a simple rectangle with some shortcut variables, such as x2,y2 and cx,cy.
bottomleft() → Array<Number>
This method returns the bottom-left location of the bounding box as a 2-element array.bottomright() → Array<Number>
This method returns the bottom-right location of the bounding box as a 2-element array.center() → Array<Number>
This method returns the center location of the bounding box as a 2-element array.move(dx, dy) → PixMill.BoundingBox
This method moves the bounding box to a new location some distance away.moveTo(x, y) → PixMill.BoundingBox
This method moves the bounding box to a new location.moved(dx, dy) → PixMill.BoundingBox
This method creates a new bounding box based on this one, but moved some distance awayposition() → Array<Number>
This method returns the bounding box position as a 2-element array.rect() → Array<Number>
This method returns the location and size of the bounding box as a 4-element array.resize(dw, dh) → PixMill.BoundingBox ⇏ ArgumentError
This method resizes the bounding box according to specified deltas.resizeTo(w, h) → PixMill.BoundingBox ⇏ ArgumentError
This method resizes the bounding box.resized(w, h) → PixMill.BoundingBox ⇏ ArgumentError
This method creates a new bounding box at this box's location, but with a different size.setFromBox(x, y, x2, y2) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its top-left and bottom-right box positions.setFromCxyr(cx, cy, r) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its center position and a radius from the center.setFromCxywh(cx, cy, w, h) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its center position and its size.setFromCxyxryr(cx, cy, xr, yr) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its center position and x-axis and y-axis radii.setFromPts(pts) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box to a location and size which will contain all of the specified points in the array.setFromXywh(x, y, w, h) → PixMill.BoundingBox ⇏ ArgumentError
This method sets the bounding box according to its top-left box position and its size.size() → Array<Number>
This method returns the bounding box size as a 2-element array.toArray() → Array<Number>
This method returns an array representation of the bounding box.toString() → String
This method returns a string representation of the bounding box.topleft() → Array<Number>
This method returns the top-left location of the bounding box as a 2-element array.topright() → Array<Number>
This method returns the top-right location of the bounding box as a 2-element array.xywh() → Array<Number>
This method returns the location and size of the bounding box as a 4-element array.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| canvas.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class manages all canvas operations.
The Canvas class is used for defining and managing the drawing surface and its mapping to its back-end destination.
new PixMill.Canvas(width, height, ctab, fill)
This contructor creates the canvas and its underlying JS canvas element based on the given width and height. Initial color settings can also be provided.rootbox → PixMill.Rectangle <read-only>
This property defines the base-level drawing surface location and dimension of the canvas.erase() → PixMill.Canvas
This method erases the canvas.reset() → PixMill.Canvas
This method erases the canvas and resets the associated graphics state.setid(id) → PixMill.Canvas
This method assigns a DOM id to the underlying JS canvas.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines a circle marking object.
A PixMill.Circle is a circular marking object with full layout and drawing capabilities.
new PixMill.Circle(properties) ⇏ RuntimeError
This constructor constructs a circle marking object from the supplied parameters.place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.set(parent, r, scale, gs) <overload>
This overload method sets the properties of the the Circle marking object.trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| colorTable.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class manages all color table operations.
The ColorTable class is used to manage symbol-to-color specification look-ups.
new PixMill.ColorTable(source) ⇏ ArgumentError
This constructor creates a new ColorTable from an optional input source.delete(key) → PixMill.ColorTable
This method deletes an entry from the color table.get(key, type) → String or Array<Number> ⇏ RuntimeError
This method is used to retrieve a color specification from the color table. It can also reformat the color specification.getClosestCspecKey(target) → String or Null
This method finds an entry in the color table which is closest to the specific color specification.getHtmlSpec(key) → String or Null
This method is used to retrieve the HTML color specification from the color table.hasKey(key) → Boolean
This method determines if the color table has a specified key defined.keys() → Array<String>
This method retrieves all of the color table keys.load(source, on_duplicate_entry) → PixMill.ColorTable ⇏ ArgumentError
This method is used to load this color table from an input source.set(key, cspec, on_duplicate_entry) → PixMill.ColorTable ⇏ ArgumentError ⇏ RuntimeError
This method is used to set a color specification to a key. It will also create an HTML-compatible version.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines an ellipse marking object.
A PixMill.Ellipse is an elliptical marking object with full layout and drawing capabilities.
new PixMill.Ellipse(properties) ⇏ RuntimeError
This constructor constructs a ellipse marking object from the supplied parameters.place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.set(parent, xr, yr, scale, gs) <overload>
This overload method sets the properties of the the Ellipse marking object.trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines a graphic marking object.
A PixMill.Graphic is an image marking object with full layout and drawing capabilities. The layout capability is tied to the text area's bounding box.
Note: This class used to be called Image, but an Image class definition already exists in the Javascript DOM.
new PixMill.Graphic(properties) ⇏ RuntimeError
This constructor constructs a graphic marking object from the supplied parameters.draw(gs) → PixMill.MarkingObject ⇏ RuntimeError <overload>
This method defines the default marking object drawing.place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.set(parent, surface, scale, gs) <overload>
This overload method sets the properties of the the Graphic marking object.trace(gs, force_placement) ⇏ RuntimeError <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| graphicsState.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class is used to manage the graphics state for PixMill marking operations.
new PixMill.GraphicsState(args) ⇏ ArgumentError
This constructor will create a graphics state attached to a given drawing context, with an optional color table, or will build a clone of another graphics state.$bezierMinMax() → Object <private>
This private method calculates the min & max points for bezier curve extent tracking.$collectPathExtents(x, y, x2, y2) → PixMill.GraphicsState <private>
This private method manages the extents of the current path by collecting sole and/or min and max points.$configSource(index, value) → PixMill.GraphicsState <private>
This private method sets the specified source to a value in a format compatible to the platform's drawing context.To Do: This implementation is partial, missing support for patterns and shaders (incl. gradient fills)
$extractHtml5Cspec(value) → String <private>
This private method retrieves and/or converts a color specification to an HTML5-formatted one.$fillProc(path) → PixMill.GraphicsState <private>
This private method sets the fill parameters and does a fill operation on the attached drawing context.$genCanvasBbox(w, h, ctm) → Array<Number> <private>
This private method generates a 4-element bounding box of the canvas' drawing surface. The current CTM is taken into account when calculating the bounding box, so the canvas may be offset, rotated and/or scaled.$getHeight() → Number <private>
This private method returns the height of the attached canvas.$getWidth() → Number <private>
This private method returns the width of the attached canvas.$quadraticMinMax() → Object <private>
This private method calculates the min & max points for quadratic bezier curve extent tracking.$strokeProc(path, width, loc) → PixMill.GraphicsState <private>
This private method sets the stroke parameters and does a stroke operation on the attached drawing context.arc(x, y, radius, startAngle, endAngle, anticlockwise) → PixMill.GraphicsState
This method adds an arc sub-path to the current path.arcTo() → PixMill.GraphicsState
This method will draw an arc from theTo Do: This method is incomplete with regard to extent tracking.
beginPath() → PixMill.GraphicsState
This method creates a new path.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) → PixMill.GraphicsState
This method traces a cubic bezier curve from the current point to a specified point using two control points.clipto(preserve) → PixMill.GraphicsState
This method defines a clip region defined by the current path.clone(incl_stack) → PixMill.GraphicsState
This method clones the current graphics state.closePath() → PixMill.GraphicsState
This method closes the existing path.copyPath() → Path2D
This method returns a copy of the current path.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) → PixMill.GraphicsState
This method adds an elliptical arc sub-path to the current path.getPathExtents() → Array<Number>
This method returns the extents of the current path.lineTo(x, y) → PixMill.GraphicsState
This method traces a line from the current point to the given point in the current path.moveTo(x, y) → PixMill.GraphicsState
This method sets the current point in the current path.paint() → PixMill.GraphicsState
This method paints the entire canvas with the current fill source.pathToSvgPath()
This method converts the current path to an SVG format path description.pop(n) → PixMill.GraphicsState
This method pops one or more graphics states from the graphics state stack.popAll() → PixMill.GraphicsState
This method pops the entire GS stack.push(proc) → PixMill.GraphicsState
This method pushes a new graphics state onto the graphics state stack. The new graphics state is a clone of the current graphics state. If an optional procedure is supplied, the graphics state will be popped after the procedure is run.quadraticCurveTo(cpx, cpy, x, y) → PixMill.GraphicsState
This method traces a quadratic bezier curve from the current point to a specified point using a control point.rect(x, y, w, h) → PixMill.GraphicsState
This method adds a rectangular sub-path to the current path.reset() → PixMill.GraphicsState
This method resets a graphics state to its initial state.restorePath() → PixMill.GraphicsState
This method restores the current saved path and state.rrect(x, y, w, h, xr, yr) → PixMill.GraphicsState
This method adds a rounded rectangular sub-path to the current path.savePath() → PixMill.GraphicsState
This method saves the current path and state. There is no stack.set(options) → PixMill.GraphicsState
This method sets graphics state settings and properties.strokeFill(preserve) → PixMill.GraphicsState
This method does a combined fill and/or stroke operation along the current path.unclip() → PixMill.GraphicsState
This method removes the topmost clip region from the clip stack.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines a hexagon marking object.
A PixMill.Hexagon is a hexagonal marking object with full layout and drawing capabilities.
new PixMill.Hexagon(properties) ⇏ RuntimeError
This constructor constructs a hexagon marking object from the supplied parameters.place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.set(parent, size, orientation, scale, gs) <overload>
This overload method sets the properties of the the Hexagon marking object.trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class contains common code and defines a common API for all PixMill marking objects.
This PixMill.MarkingObject is a combination layout and drawing object manager. All marking objects can be drawn and can also be used as a layout parent, via its bbox (or bounding box).
new PixMill.MarkingObject()
The constructor is a no-op. The derived classes provide the functionality.$calcDim(scale, value) → Number <private> <deprecate>
This private method calculates a dimension value of the object based on the specified scale.$parentIsBase() → Boolean <private>
$parentIsViewport() → Boolean <private>
bbox() → PixMill.BoundingBox
This method returns the marking object's bbox (bounding box).Note: Some layouts may be arrays, in which case the first array is the primary bounding box.
clipto(gs) → PixMill.MarkingObject
This method sets the underlying graphics state's clip region to the marking object's shape.cliptrace(gs, force_placement) → PixMill.MarkingObject ⇏ RuntimeError
This method defines the default marking object shape tracing logic for clip region creation, aka path creation. For clip region creation, some derived objects may use its bbox as its clip region shape.draw(gs, eproc) → PixMill.MarkingObject ⇏ RuntimeError
This method defines the default marking object drawing.Note: Most of the time, the derived object don't need to override this behavior. Most of the time...
place(gs) → PixMill.MarkingObject
This method is used to set the object's layout for tracing and drawing purposes. As the base class is essentially a null object, there is no layout.set(type, parent) → PixMill.MarkingObject
This method sets the common properties of all marking objects. Each derived class will define the types of each property and interact with them.setHexagonLayout(gs, ee, orientation) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a hexagonal marking object onto a drawing context using graphics state parameters.setImageLayout(gs, surface) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place an image marking object onto a drawing context using graphics state parameters.setPolyLayout(gs, minmax) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a polygon marking object onto a drawing context using graphics state parameters.setRadiiLayout(gs, xr, yr) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a circular/elliptical marking object onto a drawing context using graphics state parameters.setTextLayout(gs, width, height) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a text marking object onto a drawing context using graphics state parameters. The width and height parameters are non-rotated parameters. If the graphics state specifies any rotation or scaling, the appropriate values will be calculated.setWhLayout(gs, w, h) → PixMill.MarkingObject ⇏ RuntimeError <protected>
This protected method is designed to place a rectangular marking object onto a drawing context using graphics state parameters.trace(gs, force_placement) → PixMill.MarkingObject ⇏ RuntimeError
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.Note: Due to how Javascript class inheritance works, while this method is defined within PixMill.MarkingObject, 'this' may be referring to a derived (real) object, so this.place() will call the correct method.
unclip(gs) → PixMill.MarkingObject
This method resets the underlying graphics state's clip region.update(props) → PixMill.MarkingObject
This method updates the property values for the marking object.viewport() → PixMill.Viewport
This method returns the marking object's viewport.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines a path marking object.
A PixMill.Path is a path marking object with full layout and drawing capabilities.
new PixMill.Path(properties) ⇏ RuntimeError
This constructor constructs a path marking object from the supplied parameters.place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.set(parent, desc, scale, gs) <overload>
This overload method sets the properties of the the Path marking object.trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| pathDescriptor.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class tokenizes an SVG-style path description.
new PixMill.PathDescriptor(desc)
This constructor tokenizes the given path description for analysis or rendering.$compile() → Boolean <private>
This private method tokenizes the path descriptor string.anyTokens() → Boolean
This method determines if any tokens have been defined.set(desc) → Boolean
This method tokenizes the given patah description.trace(gs, absx, absy, relx, rely)
This method draws the tokenized information using the given graphics state.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines a polygon marking object.
A PixMill.Polygon is a polygonal marking object with full layout and drawing capabilities.
new PixMill.Polygon(properties) ⇏ RuntimeError
This constructor constructs a polygon marking object from the supplied parameters.place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.set(parent, points, closed, scale, gs) <overload>
This overload method sets the properties of the the Polygon marking object.trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines a rectangle marking object.
A PixMill.Rectangle is a rectangular marking object with full layout and drawing capabilities. This marking object also supports rounded rectangles as well.
new PixMill.Rectangle(properties) ⇏ RuntimeError
This constructor constructs a rectangle marking object from the supplied parameters.place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.set(parent, w, h, xr, yr, scale, gs) <overload>
This overload method sets the properties of the the Rectangle marking object.trace(gs, force_placement) → PixMill.MarkingObject <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines a text marking object.
A PixMill.Text is a text marking object with full layout and drawing capabilities. The layout capability is tied to the text area's bounding box.
new PixMill.Text(properties) ⇏ RuntimeError
This constructor constructs a text marking object from the supplied parameters.cliptrace(gs) <overload>
This method defines the default marking object shape tracing logic for clip region creation, aka path creation.draw(gs) → PixMill.MarkingObject ⇏ RuntimeError <overload>
This method defines the default marking object drawing.place(gs) → PixMill.MarkingObject <overload>
This method is used to set the object's layout for tracing and drawing purposes.set(parent, string, fontscale, snap_to_ink, attribute_list, scale, gs) <overload>
This overload method sets the properties of the the Text marking object.trace(gs, force_placement) ⇏ RuntimeError <overload>
This method defines the default marking object shape tracing logic, aka path creation. It requires a layout to be set via the place API call.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| textAttributes.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class manages layout and drawing attributes for runs of characters within a text string.
new PixMill.TextAttributes(attrs)
This constructor creates a PixMill.TextAttributes object w/o any attributes defined.anyDrawingAttributes → Boolean <read-only>
This property returns true if any drawing attributes have been definedanyLayoutAttributes → Boolean <read-only>
This property returns true if any layout attributes have been definedanyUnderlineAttributes → Boolean <read-only>
This property returns true if any underline attributes have been definedlength → Integer <read-only>
This property returns the number of attributes defined$addToDrawingAttributes(name, value, si, ei) → PixMill.TextAttributes <private>
$addToLayoutAttributes(name, value, si, ei) → PixMill.TextAttributes <private>
addBackground(value, si, ei) → PixMill.TextAttributes
This method adds a background color attribute, which can optionally only apply to a range of the text.addFill(value, si, ei) → PixMill.TextAttributes
This method adds a fill attribute, which can optionally only apply to a range of the text.addFontRelSize(value, si, ei) → PixMill.TextAttributes
This method adds a font relative size attribute, which can optionally only apply to a range of the text.addFontStyle(value, si, ei) → PixMill.TextAttributes
This method adds a font style attribute, which can optionally only apply to a range of the text.addFontVariant(value, si, ei) → PixMill.TextAttributes
This method adds a font variant attribute, which can optionally only apply to a range of the text.addRise(value, si, ei) → PixMill.TextAttributes
This method adds a font rise attribute, which can optionally only apply to a range of the text.addStretch(value, si, ei) → PixMill.TextAttributes
This method adds a font stretch attribute, which can optionally only apply to a range of the text.addStrikethrough(value, si, ei) → PixMill.TextAttributes
This method adds a font strikethrough, which can optionally only apply to a range of the text.addStrikethroughColor(value, si, ei) → PixMill.TextAttributes
This method adds a strikethrough color attribute, which can optionally only apply to a range of the text.addStroke(value, si, ei) → PixMill.TextAttributes
This method adds a stroke attribute, which can optionally only apply to a range of the text.addStrokeWidth(value, si, ei) → PixMill.TextAttributes
This method adds a stroke width attribute, which can optionally only apply to a range of the text.addSubscript(value, si, ei) → PixMill.TextAttributes
This method adds a font subscript attribute, which can optionally only apply to a range of the text.addSuperscript(value, si, ei) → PixMill.TextAttributes
This method adds a font superscript attribute, which can optionally only apply to a range of the text.addUnderline(value, si, ei) → PixMill.TextAttributes
This method adds a font underline, which can optionally only apply to a range of the text.addUnderlineColor(value, si, ei) → PixMill.TextAttributes
This method adds a underline color attribute, which can optionally only apply to a range of the text.addWeight(value, si, ei) → PixMill.TextAttributes
This method adds a font weight attribute, which can optionally only apply to a range of the text.collectDrawingAttributes(si, ei) → Object
This method collects the set of drawing attributes that apply to a given range.eachBackgroundLayoutAttribute(callback)
This method calls a callback function for each background drawing attribute.eachDrawingAttribute(callback)
This method calls a callback function for each defined drawing attribute.eachLayoutAttribute(callback)
This method calls a callback function for each defined layout attribute.eachSpecificDrawingAttribute(attribute, callback)
This method calls a callback function for each specific drawing attribute.eachSpecificLayoutAttribute(attribute, callback)
This method calls a callback function for each specific layout attribute.eachUnderlineLayoutAttribute(callback)
This method calls a callback function for each underline layout attribute.| File | Language | Author(s) | Copyright |
|---|---|---|---|
| markingObjects.js | Javascript | Kenneth F. Guerin | Copyright © 2018-2024, Brick Mill Games, LLC, all rights reserved. |
This class defines a viewport onto a PixMill.Canvas.
A PixMill.Viewport is primarily a layout object which sits directly on top of the underlying PixMill.Canvas' drawing context. It differs from a Canvas' rootbox in that it can have a graphics state applied. This allows for scaling and other positioning properties to be applied just prior to interactions with the drawing context.
new PixMill.Viewport(parent, x, y)
bbox() → PixMill.BoundingBox <overload>
This overload function returns the viewport's bounding box defined in its property list.set(parent, x, y) → PixMill.Viewport ⇏ RuntimeError <overload>
This overload method sets the properties of the the Viewport marking object.