I’ve been trying for quite a few days to change a font color from inside the blueprint and haven’t figured it out.
I tried with a regular TextBlock and use the textblock object to drag off SetColorandOpacity but no matter what slate color I put in it just comes out black.
Today I have been trying RichtextBlock and had success once but then immediate power failure - by the time I got back on I couldn’t remember how I did it. I’ve tried setting a datatable with one Row (Default as the UE4 Styles docs say and set the default values I want. I then dragged “RichTextBox” out of the button it is attached to and tried Setting the style but nothing happens (I don’t even see the text then). I’ve got myself in a frazzle now.
So my question is Can I just use a regular textbox and set the font color (if so how?). If not, Can anyone point me at a video or other tutorial that explains how to do that properly with a richtextblock?. I know this will end up being simple once I see it but right now I don’t know where to look.
Well it figures. I swear I tried that but it must have been different things before I discovered slate colors so nothing would connect. Now it works perfect! That simplifies things and a Datatable with slate colors is a breeze!
Ahha, I finally figured out what was wrong. I was using a master button with a text attached. Like that there is no setting for background color that I can access, only color and opacity.
When I use a standard button and attach text to it then I can set Background color (Button itself) and ColorandOpactity which is applied to the font (automagically since I didn’t have to pull out the textbox or anything).
Now it works completely perfect! I just have to figure out the proper way when using a modular button ( I guess create a color function on the master button to change the font color(?) I dunno.
Aye, wrapping native widget in user widgets is the common practice. You can then include a custom dispatcher and have each button spit out per-instance data; make button do something more than a mere click.
Well I have it perfect with Native buttons but the masterbutton still refuses to actually change the font color.
If I just drag colorandopacity off the master object it messes with the button color (ends up black when I already set it to blue) (uses linear color)
If I drag target textbox off the master then set color and opacity (slate color) the font ends up black.
If I create a custom event in the master and change color and opacity there (slate color) using either the variable or function method - nothing happens.
It turns out I can use the master button - target button then set colorandopacity (basically the same as a native button). The only problem is that the linear color red makes the font BLACK. Green and Blue work fine though - so I’m pretty sure it’s a bug (why 2 work and 2 not otherwise). I wanted this button to have red text and it was always black so I figured it wasn’t the right way.
This is the working blueprint macro. You can see I tried the color presets and also made colors. Red is always black. Wish I had been fixated on blue, I would have figured this out about a week ago!
Ok weird. I erased all my widgets (they were experimental anyway) and created new ones. Although as far as I can tell I’m doing things the exact same way Linearcolor RED shows up red now instead of black. Well, tack that up to “Extraneous Strangeness in Programming”.