x

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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Is it possible to tag/ reference a button created in widget?

Hi,

I wounder if it's possible to tag or reference a button created in widget? And to do this in Blueprint? The reason is pretty much in this question post: https://answers.unrealengine.com/questions/316470/possible-to-get-button-reference-when-button-is-cl.html

Is it maybe possible to use GamePlay Tags esxplained here?: https://www.unrealengine.com/en-US/blog/using-gameplay-tags-to-label-and-organize-your-content-in-ue4

What I have down so far (but a bit tedious) is to set an int var just after each button is hovered. After the set variable I am executing a CircularProgressBar function for about 2sec. After that I get the int var and use SwitchOnInt to direct the event flow depending on which button is hovered.

If the button is unhovered before the CircularProgressBar function has finished, it will abort the flow execution, with a isAbortProgressBar bool var just before the SwitchOnInt node. Basically setting the bool just after the unhovered event.

I guess it works ok, but it feels it becomes ineffective if you have alot of buttons in a widget, having to set the int var repeatingly after each button event.

Thanks for any input!

Product Version: UE 4.19
Tags:
more ▼

asked May 04 '18 at 10:38 PM in Blueprint Scripting

avatar image

Kidox18
1 2 4

avatar image CatsNipYummy Jun 16 '18 at 07:34 PM

Easiest way to get what you're looking for is to subclass the UButton class and create your own custom button. You can get references to your button or add a int variable to store the tag.

avatar image Kidox18 Jun 23 '18 at 09:16 AM

Hi CatsNipYummy, thanks for your reply. When you talk about subclass the UButton, do you mean something like done in this video?: https://www.youtube.com/watch?v=Fnc8fvStTTQ

Or is it possible to achive with Blueprints only?

Thanks!

avatar image CatsNipYummy Jun 23 '18 at 04:06 PM

You can either use C++ or Blueprints. If you want the blueprints implementation, take a look at this tutorial. https://youtu.be/6CGYprd7vYU Somewhere around the 30 min mark she talks about custom buttons using BP. That worked for me.

avatar image Kidox18 Jun 24 '18 at 02:49 PM

Thanks for the link! That's what I was looking for. Good tutorial!

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

1 answer: sort voted first

I'm sure I must not understand what you mean. Is this what you are looking for?

alt text

After this is checked in UMG Designer you can access the button object just like any other variable.

alt text

Sorry if I misunderstood.

171.png (60.7 kB)
172.png (156.6 kB)
more ▼

answered Jun 23 '18 at 05:23 PM

avatar image

enearle
215 4 4 6

avatar image Kidox18 Jun 24 '18 at 02:53 PM

Thanks for the input Enearle, no worries but yes I was more looking for a smart way to tag a button if you have several of them. "CatsNipYummy" sent a very good link tut of how it could be done:

https://www.youtube.com/watch?v=6CGYprd7vYU&feature=youtu.be It's somewhere about 30min into the video.

(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