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"

How to cycle through huds with a button?

Hey all! Working on HUD lately and I'm wondering how I would go about cycling through different huds by clicking a hud button.

So character overview > equipment > status effects > achievemnts > etc.. > etc...

Basically just menu options that open up more shit like any rpg inventory ever. Except a button press not a keybinding.

Any help appreciated! thanc.

Product Version: UE 4.21
Tags:
more ▼

asked Feb 23 '19 at 04:36 AM in Blueprint Scripting

avatar image

PerCat
28 1 3 6

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Sounds like a perfect job for a widget switcher. Think of it as an array of tabs where only 1 is active and visible at a time. This allows you to populate the switcher at design time and then use an int index to display the pertinent menu. No need to spawn / hide / show any other widget apart from the controlling switcher.

It also works well with cycling as you're simply adding / subtracting 1 from the current index. So pressing left / right becomes a natural process.

more ▼

answered Feb 23 '19 at 02:52 PM

avatar image

Everynone
13.6k 74 25 57

avatar image Nebula Games Inc Feb 23 '19 at 03:29 PM

Never used a switcher but that does sound ideal I may have to look into those myself!

avatar image Everynone Feb 23 '19 at 05:25 PM

Just to demonstrate and to ensure I understood OP correctly. Imagine you want to cycle through several submenus:

alt text

You can add them to the switcher as custom widgets - so they are created automagically when the switcher widget is initialised.

And then you can cycle through any number of submenu children like so:

alt text

It generally works well. The only downside is having a slightly larger memory footprint as all the submenus reside in the memory at all times. Can be pretty much ignored unless you're targeting mobile.

Apart from the ease of use, the other plus side is that these are instantiated early so you do not need to worry about auto-wrapped text flickering in front of your eyes. Or forcing a layout prepass to get rid of it.

Definitely worth trying.

Good luck!

switcher.png (10.5 kB)
useit.png (171.6 kB)
avatar image PerCat Feb 23 '19 at 09:03 PM

Yup I ended up watching a couple tuts and switchers were exactly what I needed! Thanks man. Solved, leaving it up for anyone else in the future.

(comments are locked)
10|2000 characters needed characters left

Seems like just having a bunch of "toggle visibility" issues. The button should either create a new widget and add to the view port while removing the prior one, or depending on your setup and requirements, all the widgets could potentially be created and in the viewport at the same time and the visibility is what changes based off the button clicked. So if you click a button an inventory widget opens up, then you click a button in that inventory and it opens up a second widget that shows details about the item selected etc etc.

more ▼

answered Feb 23 '19 at 02:19 PM

avatar image

Nebula Games Inc
4.9k 27 9 14

(comments are locked)
10|2000 characters needed characters left
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