CanvasPolygon

A canvas polygon item.

More...

Constructors

this
this(double[] coords, string fillColor, string outlineColor, int outlineWidth)

Create a polygon from coordinates. Use colors from the preset color list or a web style hex color.

Members

Functions

init
void init(Canvas parent)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin FillColor

Mixin common commands.

__anonymous
mixin OutlineColor
Undocumented in source.
__anonymous
mixin OutlineDash
Undocumented in source.
__anonymous
mixin OutlineWidth
Undocumented in source.
__anonymous
mixin Vertex
Undocumented in source.

Mixed In Members

From mixin FillColor

getFillColor
string getFillColor()

Get the fill color.

setFillColor
auto setFillColor(string color)

Set the fill color. Use colors from the preset color list or a web style hex color.

getActiveFillColor
string getActiveFillColor()

Get the active fill color. An item's active state is triggered when the mouse rolls over the item.

setActiveFillColor
auto setActiveFillColor(string color)

Set the active fill color. An item's active state is triggered when the mouse rolls over the item. Use colors from the preset color list or a web style hex color.

getDisabledFillColor
string getDisabledFillColor()

Get the disabled fill color.

setDisabledFillColor
auto setDisabledFillColor(string color)

Set the disabled fill color. Use colors from the preset color list or a web style hex color.

From mixin OutlineColor

getOutlineColor
string getOutlineColor()

Get the outline color.

setOutlineColor
auto setOutlineColor(string color)

Set the outline color. Use colors from the preset color list or a web style hex color.

getActiveOutlineColor
string getActiveOutlineColor()

Get the active outline color. An item's active state is triggered when the mouse rolls over the item.

setActiveOutlineColor
auto setActiveOutlineColor(string color)

Set the active outline color. An item's active state is triggered when the mouse rolls over the item. Use colors from the preset color list or a web style hex color.

getDisabledOutlineColor
string getDisabledOutlineColor()

Get the disabled outline color.

setDisabledOutlineColor
auto setDisabledOutlineColor(string color)

Set the disabled outline color. Use colors from the preset color list or a web style hex color.

From mixin OutlineDash

getOutlineDash
int[] getOutlineDash()

Get the dash pattern.

setOutlineDash
auto setOutlineDash(int[] dash)

Set the dash pattern of the outline. Each element represents the number of pixels of a line segment. Only the odd segments are drawn using the outline color. The other segments are drawn transparent.

getActiveOutlineDash
int[] getActiveOutlineDash()

Get the active dash pattern. An item's active state is triggered when the mouse rolls over the item.

setActiveOutlineDash
auto setActiveOutlineDash(int[] dash)

Set the active dash pattern of the outline. Each element represents the number of pixels of a line segment. Only the odd segments are drawn using the outline color. The other segments are drawn transparent. An item's active state is triggered when the mouse rolls over the item.

getDisabledOutlineDash
int[] getDisabledOutlineDash()

Get the disabled dash pattern.

setDisabledOutlineDash
auto setDisabledOutlineDash(int[] dash)

Set the disabled dash pattern of the outline. Each element represents the number of pixels of a line segment. Only the odd segments are drawn using the outline color. The other segments are drawn transparent.

getOutlineDashOffset
int getOutlineDashOffset()

Get the dash offset.

setOutlineDashOffset
auto setOutlineDashOffset(int offset)

Set the dash offset.

From mixin OutlineWidth

getOutlineWidth
int getOutlineWidth()

Get the width of the outline.

setOutlineWidth
auto setOutlineWidth(W width)

Set the width of the outline.

getActiveOutlineWidth
int getActiveOutlineWidth()

Get the width of the active outline. An item's active state is triggered when the mouse rolls over the item.

setActiveOutlineWidth
auto setActiveOutlineWidth(W width)

Set the width of the active outline. An item's active state is triggered when the mouse rolls over the item.

getDisabledOutlineWidth
int getDisabledOutlineWidth()

Get the width of the disabled outline.

setDisabledOutlineWidth
auto setDisabledOutlineWidth(W width)

Set the width of the disabled outline.

From mixin Vertex

getJoinStyle
string getJoinStyle()

Get the join style.

setJoinStyle
auto setJoinStyle(string joinStyle)

Specifies the ways in which joints are to be drawn at the vertices of the line. If this option is not specified then it defaults to round. If the line only contains two points then this option is irrelevant.

getSmoothMethod
string getSmoothMethod()

Get the smooth method.

setSmoothMethod
auto setSmoothMethod(string smoothMethod)

If the smoothing method is bezier, this indicates that the line should be drawn as a curve, rendered as a set of quadratic splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated within a curve by duplicating the end-points of the desired line segment. If the smoothing method is raw, this indicates that the line should also be drawn as a curve but where the list of coordinates is such that the first coordinate pair (and every third coordinate pair thereafter) is a knot point on a cubic bezier curve, and the other coordinates are control points on the cubic bezier curve. Straight line segments can be generated within a curve by making control points equal to their neighbouring knot points. If the last point is a control point and not a knot point, the point is repeated (one or two times) so that it also becomes a knot point.

getSmoothSplineSteps
int getSmoothSplineSteps()

Get smooth method spline steps.

setSmoothSplineSteps
auto setSmoothSplineSteps(int splineSteps)

Specifies the degree of smoothness desired for curves: each spline will be approximated with number line segments.

Inherited Members

From CanvasItem

type
string type [@property getter]

Get the type of canvas item.

init
void init(Canvas parent)
Undocumented in source. Be warned that the author may not have intended to support it.
getCoords
double[] getCoords()

Get the coords of this item.

setCoords
auto setCoords(double[] coords)

Set the coordinates used to draw this item.

getTags
string[] getTags()

Get the tags associated with this item.

setTags
auto setTags(string[] tags)

Set tags associated with this item.

addTag
auto addTag(string tag)

Add a specific tag to this item.

deleteTag
auto deleteTag(string tag)

Delete a specific tag associated to this item.

clearTags
auto clearTags()

Delete all tags associated to this item.

destroy
void destroy()

Destroy this item and remove it from the canvas.

focus
auto focus()

Set the keyboard focus to this item in the canvas.

lower
auto lower()

Lower an item in the drawing order.

raise
auto raise()

Raise an item in the drawing order.

moveBy
auto moveBy(int xAmount, int yAmount)

Move an item on the canvas by an amount.

moveTo
auto moveTo(int xPos, int yPos)

Move an item on the canvas to a position.

scale
auto scale(double xOrigin, double yOrigin, double xPercent, double yPercent)

Scale an item on the canvas. Note that some items have only a single pair of coordinates (e.g., text, images and widgets) and so scaling of them by this command can only move them around.

__anonymous
mixin Bind

Mixin common commands.

__anonymous
mixin State
Undocumented in source.

Detailed Description

Common Commands

These are injected common commands that can also be used with this canvas item.

FillColor
OutlineColor
OutlineDash
OutlineWidth
Vertex

See Also

Meta