The titles says it all. I have 5 text blocks already created in a canvas and I want to set them to visible when something happens and change their text depending on the situation.
I watched it but it still doesn’t answer my question since you’re making the text blocks by code, I just want to set their visibility and edit the text (i already made the canvas and text blocks)
That’s the point, you have to do it via code though. I have no idea how to do it otherwise, I don’t think you can.
Create a method like this to convert the text from a string
to a message
type:
SetDynamicText<localizes>(Value:string) : message = "{Value}"
Then when you want to update the text, call SetText
on the text block:
_textWiget.SetText(SetDynamicText("Dynamic Text!"))
And then to change a wiget’s visibility, call SetVisibility
on your canvas:
_canvas.SetVisibility(widget_visibility.Visible)
_canvas.SetVisibility(widget_visibility.Hidden)
That’s great but I don’t know how to call it on my script. do I make an @editable and call it like that
Here is an example:
I understand the code but what I don’t understand is how do i define it. Do i just do _textWidget (replace that with text block bame) or do i need to do anything else before that