Announcement

Collapse
No announcement yet.

Calling button click event outside Widget BluePrint

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by UndeadRaiden View Post
    This is what you need, really useful when you know how.
    https://www.youtube.com/watch?v=k-MAALv3P-Y
    Hey Raiden, this should do it for me. Thanks a bunch!

    Leave a comment:


  • replied
    This is what you need, really useful when you know how.
    https://www.youtube.com/watch?v=k-MAALv3P-Y

    Leave a comment:


  • replied
    It's probably not the right way to do it, but let me explain more clearly what I'm trying to accomplish.

    I want to create multiple shops, selling and showing different items. But, I would like all shops to work with the same widget blueprint. Therefore, I want the widget blueprint to use the actor's variables and use that to display and sell the items in that shop widget.

    So here is what I think I have to do. I need to create the visual HUD in the widget blueprint, but then script the functionality in an actor, so that I can duplicate that actor and simply change the item variables but have it function instantly. I know I can 'hardcode' the items in the widget blueprint, but that wouldn't allow me to duplicate the actors without duplicating that shop widget with it.

    I hope that sheds some more light on what I was trying to accomplish. I'll just script everything in the HUD widget for now, as I don't see another way that fits my skill set.

    Leave a comment:


  • replied
    Calling OnClicked directly is not the right way to do it. Instead, call the Item1Clicked event from outside.
    I don't understand what the problem is here. If you don't want to call Item1Clicked from the outside, just don't call it from the outside?
    In general, tying "clicked the first button" to some action is too much coupling; it's better to have an event for "I want to preview thing X" as that's more descriptive of what you actually want to do.

    Leave a comment:


  • replied
    Hi Starcom,

    Thanks for your reply. I'm trying to call the OnClicked event outside the of the UMG widget, not inside. Thanks for taking the time though .

    Leave a comment:


  • replied
    Hi FarmerRob,

    If you want to call the event directly from the HUD, you should create a button that you need to press inside the HUD, and create the event called by the button click.
    Click image for larger version

Name:	Screen 1.jpg
Views:	1
Size:	68.5 KB
ID:	1113792
    Click image for larger version

Name:	Screen 2.jpg
Views:	1
Size:	115.6 KB
ID:	1113793Click image for larger version

Name:	Screen 3.jpg
Views:	1
Size:	33.9 KB
ID:	1113794

    Leave a comment:


  • started a topic Calling button click event outside Widget BluePrint

    Calling button click event outside Widget BluePrint

    Hey everyone,

    Short version:
    I'm wondering if it's possible to call the Widget 'onbuttonclick' event inside of an Actor BluePrint.

    Long version:
    I've created a Widget BluePrint, with some buttons. But I want to script the functionality in an actor blueprint, for these buttons. I managed to create the following set-up:
    Click image for larger version

Name:	UE_ButtonClick.png
Views:	1
Size:	61.7 KB
ID:	1191720

    You can see that I call a custom event 'Item1Clicked', that requests a Brush variable 'image preview'. Now I want to set this brush variable onto the actor blueprint, so that I can easily duplicate the functionality and modify it in the world outliner.
    I can get this working by calling a keypress event like so:
    Click image for larger version

Name:	UE_ActorScript.png
Views:	1
Size:	49.3 KB
ID:	1191721

    The problem is, I don't want to call this event when pressing "M", or any other key. I only want to call this when I'm clicking on that widget button. But I don't know how...

    I hope I provided enough info,

    Rob
Working...
X