Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Get widget text box by name/id.

I am trying to create a couple different dynamic forms for my game. The forms have a handful of different text boxes for user input. I want to be able to add a function to my base widget to get the value from a text box based on the name of the text box component. However, I can't seem to find anyway in blueprints to get all the text box components in a widget so I can find the text box by name.

Product Version: UE 4.10
more ▼

asked Mar 01 '16 at 08:47 PM in Blueprint Scripting

avatar image

1 1 2 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

alt text

You can hold your text block as a variable in your widget by ticking the tickbox indicated. Using that reference it's just a simple matter of calling GetText on that variable.

more ▼

answered Mar 01 '16 at 10:23 PM

avatar image

186 4 7 13

avatar image aquaix Mar 02 '16 at 01:57 AM

I am aware I can expose the variable, but I am looking for a more elegant solution. I have a base widget that all my widget forms are inheriting from. I want to be able to add a function to that widget called GetTextBoxValue(string textboxName) that will return the value of a text box in the widget. That way I don't have to worry about casting to specific widget and can use the base widget function to get a text box value from any of the derived widgets.

avatar image Baeldan Mar 02 '16 at 02:34 AM

If the goal is to avoid casting, then I would recommend implementing an interface. However if you absolutely need to be able to use a string, I'm unsure. I believe you can easily retrieve an array of components of an actor but don't know about a widget.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question