Announcement

Collapse
No announcement yet.

UMG Widget Navigation and focusing on Custom Widgets

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

    UMG Widget Navigation and focusing on Custom Widgets

    So, this is going to be a post with several questions in one... let me start from the beginning.

    I've created a custom widget blueprint which is composed of an image and a label inside a vertical group (not important, but I've illustrated it below)

    Click image for larger version  Name:	unreal_missinStar_hierarchy.png Views:	43 Size:	9.0 KB ID:	1714828

    Now I'm including a set of 5 of these in a menu (inside a Horizontal Group) with two more buttons, and I'm having some trouble having the player navigate through the menu with the keyboard. My first question is: is there some good instructional material on how the Navigation properties work? I'm not sure how they work(like what "Escape", "Wrap" and "Explicit" mean), documentation is very scarce and in general it seems that the natural navigation flow of the widgets require them to be aligned which is... not very useful, most of the case.

    The second thing is: I've made this custom widget blueprint "Focusable" and implemented some stuff in the On Focus Event function to animate the star when the player selects it. Still, the only way I can focus on these widgets is by using Tab, using directional buttons only move around the Button widgets, and not in these custom widgets. How can I make them work properly? Isn't just making them "Focusable" enough?

    I'm don't have access to my Unreal editor right now, but if anyone has an idea and needs more info I can provide more screenshots later on. Still, any help is very welcome.

    #2
    Escape - gets out to another widget when you run out of options.
    wrap - a goes back to the original entry.
    explicit - I have no idea ther . Never used it.

    Widgets by default aren't really setup to just handle user input - that's what I was telling you last time unless by some coincidence you happen to be using the same star as on a different forum post.

    You have to manually code what happens by writing your own overwrite of the OnKeyPress function.
    This can get quite complex.
    not sure there are any Good tutorials on it either, everyone handles input however they feel like after-all.

    Comment


      #3
      I don't think we were talking about user input on the last post I wrote which was about layout arrangement...

      Either way, some widgets do work as intended when they are nicely aligned, or when using Explicit (from what I gather, it goes to any widget that you provide the name of). What I'm having trouble figuring is how to make these custom widgets work like buttons do (they do get keyboard focus automatically), it's weird that some of them seem to be implemented and most of them are not.

      Anyway, guess it'll have to be the hard way, then.

      Comment


        #4
        I'm going to bump this topic because I have one more question actually...

        I've started making a custom menu navigation system, as suggested, and while I managed to work the navigation part, I'm having trouble actually selecting the widget. Is there an easy way to call the On Clicked event of a Button in the blueprint? Or maybe simulate a click on it? I know delegates are an option, but I was hoping to not have to make a reference to every single event I have defined for my different buttons...

        Comment


          #5
          I think you are not exactly doing what I meant. Let me be more direct.

          On the master widget blueprint
          Create an onKeyDown event.
          Detect the input
          Decide what to do.

          Once you decide what to do with the input, you can implement the On Click as an interface call (has a message symbol).

          Assuming you coded your event to handle any input on anything - a big assumption, which is why this a complex thing...

          Adding a button to the widget, you'll be able to define what happens on the click event for that button by simply selecting the button and finding the OnClick event.
          The master widget OnKeyDown even is what takes care of calling out via the Call On Click (interface like thing).

          Comment

          Working...
          X