Change color of editable text in rintime

I like this idea with Border but i can’t see my text. I repeated the action on the gif, but maybe smth wrong

Hi, does anyone know if it is possible to change the color or font of the editable text block? I’ve tried working with the styling of the widget, but it just doesn’t work.
I mean without cpp, bp only.

Afaik, this property is not exposed to blueprints dynamically (either by omission or some nefarious purpose…). As in, BPs cannot directly set the colour of the Editable Text widget run-time (you can outside of PIE, ofc). So you need a workaround, pick one:

  • wrap the Editable Text in a user widget - this way the parent can directly manipulate the slot via Set Color and Opacity. This may be useful if you want the text to handle some logic. Otherwise go for the next option…
  • wrap the Editable Text in a border with a transparent brush, this way the border can set the Content Color and Opacity of its child, as in:

Image from Gyazo

In this case, you will be modifying the Content of the border that holds the text, rather than text itself. It works well enough, though.

2 Likes

What is the border’s Content color set to? The opacity there has to be 1.0; 0.0 for the brush.

Perhaps you forgot to set default text?

In this scenario, it’s also a good idea to let the text inherit the colour.

Is it possible to remove the border’s colored background when selecting text by mouse cursor?

Not sure what you mean, if you make the border brush’s opacity 0.0, then you can’t see the border:

Image from Gyazo

2 Likes

How to change the font color of editable text box?

In case someone is still looking for an updated answer on this without wrapping in another widget. Select Inheritg on the color

image

then make your Editable textbox a variable

image

then use set foreground Color in your function

image

1 Like