Can anyone show me an example of how to properly invoke the new method using InsertTextParams? Thanks.// The following method is deprecated, but remains for older scripts.
// Use the new void InsertText(int32 lineOffset, InsertTextParams *textParams) method instead
void InsertText(const char *text, const char *font, bool fill, bool stroke, bool groupTogether, bool centerH, int32 lineOffset);
How to set values for InsertTextParams
Moderators: Víctor Paredes, Belgarath, slowtiger
- strider2000
- Posts: 506
- Joined: Sat Mar 07, 2015 5:14 pm
- Contact:
How to set values for InsertTextParams
I see that InsertText is deprecated and we should use the new method, but I don't know how to set the values for InsertTextParams and whether or not the fields in the struct have default values (ie do they all need to be explicitly set).
- synthsin75
- Posts: 9972
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: How to set values for InsertTextParams
I know this is a really old post, but it's where I first landed trying to figure this out/remember it myself.
For adding text to a mesh layer:
For creating a new text layer:
Invokes insert text dialog, populated with the setting set in param:
The param indexes and data types are listed here: http://mohoscripting.com/methods/85
For adding text to a mesh layer:
Code: Select all
local param = MOHO.MohoGlobals.InsertText
param.Text:Set("Hello")
moho:InsertText(param, 0)
Code: Select all
local param = MOHO.MohoGlobals.InsertText
param.Text:Set("Hello")
param.OneFill = true
param.MakeLayer = true --only works for moho:CreateTextObject() or text layer
moho:CreateNewLayer(MOHO.LT_TEXT)
moho:InsertText(param, 1000)
Code: Select all
moho:CreateTextObject()
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/