Change the Style and Alignment of Input Text

Hello! :wave:

My request is that the input Text has the possibility to style and change de alignment of the text as in bbtext using tags.

Thanks!

1 Like

Hello Rasterisko,

Thank you for your request :slight_smile:
When you say “style” and “alignment” do you mean :

  • Being able to apply font weight to the text (italic, bold, underlined…)?
  • Being able to change the alignment of the text (justified, align left, align right, center…)?

If the answer is yes… why would you need to personalise the type on input text? Could you share an example?

He means that
01

I think tags/bbcodes are not the right thing for the input object, because internally it works very differently from the text objects. But settings and actions to style the text in the input field is absolutely possible.
Last year I submitted a request on Github for a few improvements.

2 Likes

Jack, would you be able to tell me if these improvements suggested by you on github could be implemented by an extension using javascript?
Sorry if the question doesn’t make much sense, but I don’t know anything about programming.

I’m not sure.
I can do it in the preview but it looks like it doesn’t have an ID to address a specific field and applying it to every existing input fields with javascript didn’t work.

1 Like

Hello fellow friends, here is the code that allows you to change the text input alignment:

runtimeScene.getObjects("Name")[0]._renderer._input.style.textAlign = "center";
1 Like

Hello, Reborn!

Thanks for your help! I don’t understand programming, so I have a question. With this code, is it possible to change the text input alignment in a specific field for the Input Text object? Or will the code automatically change the entire alignment of the object?

I didnt undertand the question, it will change the text alignment of the first instance of object “Name”, just like what you expect to happen with any other text object type