Text leading spaces

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
codegen
Posts: 9
Joined: Tue Apr 14, 2020 2:26 am

Text leading spaces

Post by codegen »

I'm a professor in Computer Engineering, and I mostly use Moho for animations for teaching.

One common theme is a snippet of code in one part of the frame and animated object illustrating the code in the rest of the frame.
However, the snippets of code must be indented.

Code: Select all

void swap(int *a, int *b){
    int tmp = *a;
    *a = *b;
    *b = tmp;
}
However, if I put it in a single text layer, everything is left justified. I've been looking both online and in the manual, but I haven't found anything.
Is there any way to use leading spaces on multi line left justified text?
My current workaround is each line in a separate text layer in a group.
Thanks.
User avatar
hayasidist
Posts: 3832
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Text leading spaces

Post by hayasidist »

lots of options. Some involve using another program (my personal preferred route BTW).. but that rather depends on what you need to do with the text.

Even so. assuming it's all in Moho.

put it all in one layer, but make it a vector (not text) layer.
select all the points in the lines that you want to indent and use the point translate tool to move them to the right..

Image

[EDIT: image added...]
Last edited by hayasidist on Wed Jul 03, 2024 9:42 pm, edited 1 time in total.
User avatar
teienkawi
Posts: 25
Joined: Sat May 20, 2023 12:15 pm

Re: Text leading spaces

Post by teienkawi »

it wont be so clean but ive used the vertical line symbol ( shift \) at the beginning of each line so sorta framed the text. though using it for coding may be confusing ( i dont know coding at all)
codegen
Posts: 9
Joined: Tue Apr 14, 2020 2:26 am

Re: Text leading spaces

Post by codegen »

Thanks to both of you. I didn't think about vectorizing the text, mostly because the only thing I do with it is fade it in and out. But that would be a reasonable approach. To use the second suggestion, I think I could put line numbers at the beginning of each line, and then the spaces would indent the code.

Thanks again.
User avatar
synthsin75
Posts: 10254
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Text leading spaces

Post by synthsin75 »

If you didn't want to use line numbers, "invisible" characters might work.

Image
I used Ideographic Space from: https://www.editpad.org/tool/invisible-character

Or just mask out the anchoring vertical line of characters.
Post Reply