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"

Custom Widget OnClicked Event?

Hello,

I have a Custom Widget button, and I would like to have several of it in a menu interface. Kind of like a template for a ready-made button. I have rigged the animations and binded the text as a public variable to allow individual text editing for each of the buttons, however, I am not able to find the Event OnClicked or Event OnPressed or any of those for my custom button. Is there something I've done wrong? How can I somehow access an OnClicked Event for each individual button to perform separate functions when clicked?

Product Version: Not Selected
Tags:
more ▼

asked Aug 10 '16 at 10:21 PM in Blueprint Scripting

avatar image

TornadoStorm
102 19 20 24

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

1 answer: sort voted first

There is a couple of different ways to do this and it is entirely up to you.

Option 1 ) Get a reference to your button template's button object, and bind in your parent widget.
In the parent widget's Construct event you can get the reference to your variable and from that drag off a pin for the actual button inside the object. From that button you can drag off another pin and type "assign" or "bind" to bring up the events that are available for binding. Assign does the job of generating a local event for your convenience, bind is useful if you want to create uobject bound functions (both are worth explaining, but you should be able to just assign for now)
The event that is generated will now fire any time you press the button you are binding it from and only that button. You can do this to multiple buttons to have multiple different effects.

Option 2 ) Expose an Event Dispatcher and call that event dispatcher inside your template widget, binding in your parent widget.
This option allows for some more control over general activity inside your template, but also allows you to define unique behavior in roughly the same way as above.
First you would add an Event Dispatcher to your button template, then you would make sure to Call that event dispatcher inside your template on the local button's Button Clicked event. Now, you should be able to select that template in the parent widget and it should have an interface for your custom event to be added to your parent blueprint in much the same way that buttons currently can.

Hope this helps!
-Spiris

more ▼

answered Aug 11 '16 at 04:27 AM

avatar image

Spiris
1.1k 41 34 76

avatar image TornadoStorm Aug 11 '16 at 07:02 AM

Thanks for the help! I used the Event Dispatcher option so I could learn what they are. It also seems to be a better option in terms of functionality. Appreciate it!

(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