Class: oShape

$. oShape

$.oShape represents shapes drawn on the art layer. Strokes, colors, line styles, can be accessed through this class.
Warning, Toonboom stores strokes by index, so stroke objects may become obsolete when modifying the contents of the drawing.

new $.oShape(index, oArtLayerObject)

openHarmony/openHarmony_drawing.js, line 1131
The constructor for the $.oShape class. These types of objects are not supported for harmony versions < 16
Name Type Description
index int The index of the shape on the artLayer
oArtLayerObject $.oArtLayer The oArtLayer this layer belongs to.
Properties:
Name Type Description
index int the index of the shape in the parent artLayer
artLayer $.oArtLayer the art layer that contains this shape

Members

readonlybounds$.oBox

The bounding box of the shape.

readonlycontoursArray.<$.oContour>

The contours (invisible strokes that can delimit colored areas) making up the shape.

readonlyfillsArray.<$.oFillStyle>

The fills styles contained in the shape

readonlyheightfloat

The height coordinate of the shape.

selectedbool

Retrieve and set the selected status of each shape.

readonlystencilsArray.<$.oStencil>

The stencils used by the shape.

readonlystrokesArray.<$.oShape>

The strokes making up the shape.

readonlywidthfloat

The width of the shape.

readonlyxfloat

The x coordinate of the shape.

readonlyxfloat

The x coordinate of the shape.

Methods

deleteShape()

openHarmony/openHarmony_drawing.js, line 1391
Deletes the shape from its artlayer. Warning : Because shapes are referenced by index, deleting a shape that isn't at the end of the list of shapes from this layer might render other shape objects from this layer obsolete. Get them again with artlayer.shapes.
Deprecated
  • use oShape.remove instead

    getStrokeByIndex(index){$.oStroke}

    openHarmony/openHarmony_drawing.js, line 1402
    Gets a stroke from this shape by its index
    Name Type Description
    index int
    Returns:
    Type Description
    $.oStroke

    remove()

    openHarmony/openHarmony_drawing.js, line 1369
    Deletes the shape from its artlayer. Updates the index of all other oShapes on the artLayer in order to keep tracking all of them without having to query the drawing again.