class Standard . DrawingShape {
array boundingBox;
array fillGradients;
assoc fillMatrix;
int32 fillStyle;
array lineColor;
int32 lineWidth;
assoc matrix;
any solidFillColor;
int32 visible;
} inherits from DrawingObject;
A DrawingShape object is a subclass of DrawingObject that deals with lines, polygons and filled areas.
DrawingShape:create(int32 xmin, int32 ymin, int32 xmax, int32 ymax)
See initialize. By default, a shape will be drawn with a black, single pixel wide line and no fill. These defaults are altered by methods such as setLineStyle and setFillStyle. A shape is also visible by default; the visibility can be adjusted by setVisibility.
DrawingShape:initialize(int32 xmin, int32 ymin, int32 xmax, int32 ymax)
The initialize method sets the bounding box for the shape by specifying the the upper left and lower right corners.
DrawingShape:setVisibility(optional int32 flag)
Set the visibility of the shape. If the optional Boolean argument is not specified, the shape is marked as visible. Shapes that are not visible are usually used as DrawingAlias objects. Depending on the capabilities of the rendering engine, this enables only one copy of the shape to be sent and drawn in multiple locations using various colors and transformations.
DrawingShape:getVisibility()
Returns a Boolean flag indicating the visibility of a shape.
DrawingShape:setBounds(int32 xmin, int32 ymin, int32 xmax, int32 ymax)
The setBounds method alters the bounding box of the shape. The bounding box is described by specifying the the upper left and lower right corners.
DrawingShape:getBounds()
Returns a 4-element array representing the bounding box of the shape.
DrawingShape:setLineWidth(int32 width)
Set the width of line. No adjustment is made to the color. Use setLineStyle to set the line color and width in one step.
The value 0 will be returned.
DrawingShape:getLineWidth()
Returns the width of the drawing line.
DrawingShape:setLineColor(int32 red, int32 green, int32 blue, optional int32 alpha)
Sets the color of the drawing line without adjusting its width. If alpha is not specified, it defaults to 255. Use setLineStyle to set the line color and width in one step.
The value 0 will be returned.
DrawingShape:setLineStyle(int32 width, int32 red, int32 green, int32 blue, optional int32 alpha)
If alpha is not specified, it defaults to 255.
The value 0 will be returned.
DrawingShape:getLineColor()
Returns the color of the line as a 4-element array (red, green, blue, alpha). Each element has a value ranging between 0 and 255.
DrawingShape:getLineStyle()
Returns a 2-element array. Subscript 0 holds the width of the line; subscript 1 holds a 4-element array specifying the drawing color.
DrawingShape:getFillStyle()
Returns an array describing the shape's fill style. Subscript 0 identifies the type of fill to be performed: FILL_STYLE_NONE, FILL_STYLE_SOLID, FILL_STYLE_LINEAR_GRADIENT, FILL_STYLE_RADIAL_GRADIENT. For FILL_STYLE_SOLID, subscript 1 holds a 4 element array that specifies the fill color as an (red, green, blue, alpha) quad.
DrawingShape:setNoFill()
The value 0 will be returned.
DrawingShape:setSolidFill(int32 red, int32 green, int32 blue, int32 alpha)
The value 0 will be returned.
DrawingShape:getSolidFillColor()
Returns the fill color of the shape as a 4-element array (red, green, blue, alpha). Each element has a value ranging between 0 and 255.
DrawingShape:setLinearFill(array leftRGBA, array rightRGBA)
DrawingShape:setLinearFillCenter(int32 x, int32 y)
DrawingShape:setRadialFill(array centerRGBA, array outsideRGBA)
DrawingShape:setRadialFillCenter(int32 x, int32 y)
DrawingShape:setBitmapFillJPEG(string jpegData, optional int32 fillTiled)
DrawingShape:setBitmapFillLossless(int32 x, int32 y, string bitmapData)
DrawingShape:translate(int32 x, int32 y)
DrawingShape:rotateAndSkew(int32 skewRotate1, optional int32 skewRotate2)
DrawingShape:rotateDegrees(int32 degrees)
Note: perform scale before rotateDegees.
DrawingShape:scale(any x_scale, any y_scale)