Offset in y position for text element.
Dear all,
I'm trying to add an offset for a text element in y position. The corresponding part in my macro are lines below. However, the commands with offsetX and offsetY don't seem to have any effect. What am I doing wrong? Thanks for your help! The whole macro is attached. Cheers, Philipp
var text = newElement(Element.STAFF_TEXT);
var fontSizeTag="";
text.text = fontSizeTag+fingering;
text.offsetX= xPos;
text.offsetY = (cursor.element.notes.length - 1)*offsetFactor;//yPos;
text.placement = textposition;
text.autoplace = false;
cursor.add(text);
Attachment | Size |
---|---|
FlötenGriffe.qml | 7.88 KB |
Comments
I am in the same situation with the Shakuhachi notation etc.
text.placement = Placement.below
works, but offsetX and offsetY don't work, so all accidental notation overlaps the same place.
That looks like a bug actually, the code you show is intended to work. There seems to be a workaround though: if you set placement and offset after adding the element to a score, those parameters become set properly:
In reply to That looks like a bug… by dmitrio95
I implemented a fix for this issue so this workaround shouldn't be needed since 3.3 version.
See #294910: Plugin API: setting properties before adding an element to a score may work incorrectly.
In reply to I implemented a fix for this… by dmitrio95
Thank you!
I'm using ver 3.3 Beta2, but the problem was solved only when the order of the lines was changed.
In reply to Thank you! I'm using ver 3.3… by tcbnhrs
3.3 Beta 2 doesn't have that fix, the latest development build though has and the 3.3 RC will have it too
In reply to I implemented a fix for this… by dmitrio95
Ok, thank you very much! Do you know when 3.3. will be released?
In reply to Ok, thank you very much! Do… by Philipp König
See https://musescore.org/en/node/293812