Text block formatting

are there undocumented features allowing to format text?
something along the texfield object (text wrap, alignment …)

I’d like to have a text inserted by the user able to auto wrap inside a fixed width rectangle.
I’m thinking about writing some code and do it by myself but you know… why reinvent the wheel?

Idk if this is what u needed, but here’s a file: text1-23-2021_8-23-19.wick (5.1 KB)

The text will be aligned in the center. See the default script to change the text’s format, and click play. You should be able to customize the text a bit through html (see frames load script).

thankyou hamzah
this is interesting because it made me note that text in wick is not a canvas element but a layer positioned over the canvas
that means that it can be styled with css
now if only he had an id or a class it would be easiar to target it

ok I take it all back
wick uses canvas text and saw your pretty impressive code
now I need a little time to digest it

I’ll have to give credit to Wick for the code, all I did was just adjust the built-in text box a bit to change its element type to normal text and add in a setText function for it, then used html to edit the text style.

ty Hamzah
it was what I needed
here attached you’ll find a slightly modified version that hide the white rectangle at runtime so you have a perfectly transparent background

text1-24-2021_10-33-28.wick (5.1 KB)

just discovered it wont work inside a clip :disappointed_relieved: :disappointed_relieved:
wrong coordinates

In default, lines 22 and 23 adjust the coordinates. You can change these numbers depending on where inside of a clip you would want this text to be.

no it wont work
when you place the asset inside a clip it looses it’s magic
all the texts get aligned very close to 0, 0 without connection of their clip placement

Can you share an example in a wick file so I see what u mean?

The child clips use relative coordinates with respect to their parent clip. Did you tried to Add/sum the parent coordinates into the child coordinates?

I tried but I may have done something wrong
reading the code it looks like the text get the absolute position of his parent so adding other clips coordinates should not be necessary

1 Like

ok finally made it
it’s all in line 6 and 7 of default code of box clip. this will work also for library asset input text I guess
by the way if you move the container clip the div position will adjust. nice script.
Ty hamzah and jovanny for support

text1-25-2021_9-23-29.wick (5.4 KB)

2 Likes