Maybe I’m an idiot, but I simply cannot figure out Slate.
I can draw an FString of predefined text to the screen and move it around, so I guess I know a little bit about Slate, but I am completely lost when it comes to changing that text.
I have an actor in the world that keeps track of it’s own internal variable, which increments pretty often. Instead of spamming the log with this value, I’d like to print it to the screen. I’ve been trying to figure this out for two or three days now, and I have made absolutely zero progress.
My questions are:
- I know that this is going to require a “delegate”, and I think that has something to do with either a SLATE_ARGUMENT or a SLATE_ATTRIBUTE. Args are for variables and attribs are for functions, right? I could either pass the value from the actor in the world to the HUD, or I could, from the HUD, call a function within the actor to return the value. Which would be best? Which would be the most simple? I’ve already asked about this on the AnswerHub, but that honestly did more harm than good because I’m even more confused now than before I asked.
- Since Slate works with FText, and the value I’d like to display on screen consists of both static words and dynamic numbers, how do I concatenate things with FText? I’ve looked at FText::Format, but I can’t get it to work without LOCTEXT and I can’t figure out how to set up a LOCTEXT_NAMESPACE
- Slate is better than Canvas, right? Is there a good reason for me to be repeatedly bashing my head into this wall, or should I just salvage what I can from my old UDK Canvas code? Is there any performance gain with Slate?
Thanks in advance.