Text Object

Atjaunināts pirms 4 years

This documentation applies to plugins for 1.x only!


Documentation for 2.x+ is built into the Plugin Creator of Musescore.

( ⇒ In Musescore press Ctrl+Shift+P, then F1 to bring it up. )


Click here for Documentation for 3.x



Represents a textual element of a score.

A new Text belonging to a score can be created with:
  text = new Text(score);
where score is a Score Object .

Currently, only 'staff text' elements can be added to a score (by moving a Cursor Object to the required point and using the Cursor.putStaffText(text) method).

See also:

Cursor Object , Score Object .

Properties

Name Type Description
color QColor the text foreground colour.
defaultFont QFont the font used to display the text. Hint: this may be set to 10 point Times with var font = new QFont("Times", 10); text.defaultFont = font;.
text string the text to display.
xOffset double the horizontal offset (in spaces*) from the default position of the text (positive: to the right, negative: to the left).
yOffset double the vertical offset (in spaces*) from the default position of the text (positive: down, negative: up).

* Note: "Spaces" is a relative measurement unique to music notation. One space unit is the vertical distance between two lines of a staff.
* Note: Due to a bug in the plugin framework, xOffset and yOffset are parsed as integers.

Methods

None.