CanvasText

A canvas text item.

More...

Constructors

this
this(double[] coords, string text, string fillColor, string anchor)

Create a text item. 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 Anchor

Mixin common commands.

__anonymous
mixin FillColor
Undocumented in source.
__anonymous
mixin TextSpecific
Undocumented in source.

Mixed In Members

From mixin Anchor

getAnchor
string getAnchor()

Get the anchor.

setAnchor
auto setAnchor(string anchor)

Set the anchor position.

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 TextSpecific

getAngle
double getAngle()

Get the text angle.

setAngle
auto setAngle(A angle)

Specifies how many degrees to rotate the text anticlockwise about the positioning point for the text; it may have any floating-point value from 0.0 to 360.0. For example, if rotationDegrees is 90, then the text will be drawn vertically from bottom to top. This option defaults to 0.0. Degrees is given in units of degrees measured counter-clockwise from the 3-o'clock position; it may be either positive or negative.

getFont
string getFont()

Get the font.

setFont
auto setFont(string font)

Specifies the font to use for the text item. The format of the string to pass when specifing a font is as follows.

getAlignment
string getAlignment()

Get the alignment

setAlignment
auto setAlignment(string alignment)

Specifies how to justify the text within its bounding region.

getText
string getText()

Get the text.

setText
auto setText(string text)

Specifies the characters to be displayed in the text item. Newline characters cause line breaks.

getMaxLineLength
int getMaxLineLength()

Get max line length.

setMaxLineLength
auto setMaxLineLength(L maxLineLength)

Specifies a maximum line length for the text. If this option is zero (the default) the text is broken into lines only at newline characters. However, if this option is non-zero then any line that would be longer than line length is broken just before a space character to make the line shorter than lineLength; the space character is treated as if it were a newline character.

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.

Anchor
FillColor
TextSpecific

See Also

Meta