Class: oArtLayer

$. oArtLayer

$.oArtLayer represents art layers, as described by the artlayer toolbar. Access the drawing contents of the layers through this class.

new $.oArtLayer(index, oDrawingObject)

openHarmony/openHarmony_drawing.js, line 686
The constructor for the $.oArtLayer class.
Name Type Description
index int The artLayerIndex (0: underlay, 1: line art, 2: color art, 3:overlay).
oDrawingObject $.oDrawing The oDrawing this layer belongs to.

Members

boundingBox$.oBox

The bounds of the layer, in drawing space coordinates. (null if the drawing is empty.)

contoursArray.<$.oContour>

The contours contained amongst all the shapes of the artLayer.

namestring

The name of the artLayer (lineArt, colorArt, etc)

selectedContoursArray.<$.oContour>

the currently selected contours on the ArtLayer.

selectedShapesArray.<$.oShape>

the currently selected shapes on the ArtLayer.

selectedStrokesArray.<$.oStroke>

the currently selected strokes on the ArtLayer.

shapesArray.<$.oShape>

The shapes contained on the artLayer.

strokesArray.<$.oStroke>

The strokes contained amongst all the shapes of the artLayer.

Methods

clear()

openHarmony/openHarmony_drawing.js, line 1000
Removes the contents of the art layer.

drawCircle(center, radius, lineStyle, fillStyle){$.oShape}

openHarmony/openHarmony_drawing.js, line 865
Draws a circle on the artLayer.
Name Type Default Description
center $.oPoint The center of the circle
radius float The radius of the circle
lineStyle $.oLineStyle optional Provide a $.oLineStyle object to specify how the line will look
fillStyle object null optional The fill information to fill the circle with.
Returns:
Type Description
$.oShape the created shape containing the circle.

drawContour(path, fillStyle){$.oShape}

openHarmony/openHarmony_drawing.js, line 952
Draws the given path on the artLayer as a contour.
Name Type Description
path Array.<$.oVertex> an array of $.oVertex objects that describe a path.
fillStyle $.oFillStyle the fill style to draw with.
Returns:
Type Description
$.oShape the shape newly created from the path.

drawLine(startPoint, endPoint, lineStyle){$.oShape}

openHarmony/openHarmony_drawing.js, line 990
Draws a line on the artLayer
Name Type Description
startPoint $.oPoint
endPoint $.oPoint
lineStyle $.oLineStyle
Returns:
Type Description
$.oShape the shape containing the added line.

drawRectangle(x, y, width, height, lineStyle, fillStyle){$.oShape}

openHarmony/openHarmony_drawing.js, line 967
Draws a rectangle on the artLayer.
Name Type Description
x float the x coordinate of the top left corner.
y float the y coordinate of the top left corner.
width float the width of the rectangle.
height float the height of the rectangle.
lineStyle $.oLineStyle a line style to use for the rectangle stroke.
fillStyle $.oFillStyle a fill style to use for the rectange fill.
Returns:
Type Description
$.oShape the shape containing the added stroke.

drawShape(path, lineStyle, fillStyle, polygon, createUnderneath)

openHarmony/openHarmony_drawing.js, line 886
Draws the given path on the artLayer.
Name Type Description
path Array.<$.oVertex> an array of $.oVertex objects that describe a path.
lineStyle $.oLineStyle optional the line style to draw with. (By default, will use the current stencil selection)
fillStyle $.oFillStyle optional the fill information for the path. (By default, will use the current palette selection)
polygon bool optional Wether bezier handles should be created for the points in the path (ignores "onCurve" properties of oVertex from path)
createUnderneath bool optional Wether the new shape will appear on top or underneath the contents of the layer. (not working yet)

drawStroke(path, lineStyle){$.oShape}

openHarmony/openHarmony_drawing.js, line 941
Draws the given path on the artLayer.
Name Type Description
path Array.<$.oVertex> an array of $.oVertex objects that describe a path.
lineStyle $.oLineStyle the line style to draw with.
Returns:
Type Description
$.oShape the shape containing the added stroke.

getShapeByIndex(index){$.oShape}

openHarmony/openHarmony_drawing.js, line 1015
get a shape from the artLayer by its index
Name Type Description
index int
Returns:
Type Description
$.oShape