Convert text to vector code?
Moderators: Víctor Paredes, Belgarath, slowtiger
Convert text to vector code?
I can't find a function that allows us to convert a text layer into a regular vector. Does it exist or are there workarounds?
- synthsin75
- Posts: 10047
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Convert text to vector code?
Not that I can find, but you can set whether a text or vector layer is going to be created by the next use of the insert text tool or calling: moho:CreateTextObject()
local param = MOHO.MohoGlobals.InsertText
param.MakeLayer = false --false to create vector layer
local param = MOHO.MohoGlobals.InsertText
param.MakeLayer = false --false to create vector layer
- 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/
Re: Convert text to vector code?
I also noticed the function for creating text objects. I just didn't see any other functions for them. The more I look into this, the more it seems like the text layer was just hacked into the vector layer. It really should have its own class and functions, maybe a future Moho release.
Thanks Wes.
Thanks Wes.
- synthsin75
- Posts: 10047
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Convert text to vector code?
Yeah, unless we ask for something specific, they only create new scripting access for stuff they need in stock scripts. It's pretty rare that we get other scripting additions that we haven't asked for.
- 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/
- synthsin75
- Posts: 10047
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Convert text to vector code?
Code: Select all
local layer = moho.layer --text layer
moho:CreateNewLayer(MOHO.LT_VECTOR)
local param = MOHO.MohoGlobals.InsertText
param.Text:Set(layer:Name())
moho:InsertText(param, 0)
moho:DeleteLayer(layer)
Well, you can maintain line breaks, by leaving off "param.Text:Set(layer:Name())", but only if you open the layer's layer settings first, so it registers that as the param text.
moho:EditLayerSettings() doesn't seem to do anything.
- 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/
- hayasidist
- Posts: 3590
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Convert text to vector code?
dunno if this is helpful or irrelevant as we're in the scripting area but … there is a right-click option on a Text layer to convert it to a vector layer
- synthsin75
- Posts: 10047
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Convert text to vector code?
Yeah, I assumed he wanted something scriptable.
- 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/