How can i make main menu in unreal engine 4 blueprints - unreal-engine4

I created a fps shooter game and i want to make ui for my game (main menu) . I know i will create using widget blueprint hud's but i have an issue . I created a hud for my character it display's health , ammo, minimap , etc.
and give access to FirstPersonCharacter blueprint in event begin play node but whenever i create a main menu hud and give access to the level blueprint class . Now the problem is that whenever i play it. It shows both hud's at the same time. So how can i display the menu hud first and when i play the game using a button to load a level and then it will display the second hud . Thanks in Advance

The way I have approached this is to have a separate Level for my Main Menu.
I have a level called 'MainMenu' and a level called 'MainGame'
My MainMenu level has one set of Widgets visible which contains a Start Game button. On the 'On Clicked' event for this button, it calls the 'Open Level' function node which takes the Level Name. You have to type in the level name you want to load, which is case-sensitive (very important).
Because I have two levels, they each have their own Level Blueprint - I use these two separate level blueprints to load Widgets that are consistent only for each level.
I also have blueprint widgets showing and hiding within a single level, for example an in-game pause menu, with an options screen. I use a button that is always visible to be able to bring up the pause menu. In my pause menu, I have an options button.
I use various button's 'On Clicked' events in order to use the 'Set Visibility' function node. You can target a widget, and set it's Visibility to Visible or Hidden. This way, I can get several widgets to show/hide as I traverse an in-game menu.

Related

Unity UI Resume Game button is unclickable

So i have been trying to create a pause menu for my project, however the resume button is un-clickable (the same i believe for another button on this menu). The event system does not show anything when hovering over this button or attempting to click it.
Screenshot of Event System not showing button object
The button itself is set to interact-able and has the button's image as it's target graphic. The canvas it is also placed on also has the Graphic Ray-caster component attached. I also do not believe that there is any UI object covering the button preventing it from being clicked.Screenshot of Pause Menu UI as seen from scene view to show no blocking objects I am making use of the first person character controller starter asset by unity as well as the new input system.
I am unsure as to what could be causing this, I have also tried locking the cursor of the starter asset inputs.
Any advice would be greatly appreciated.

How to resize component in a specific state Adobe XD

I want to have this component's size to only encapsulate the info button not the whole area. Is there a way to have a component have different sizes depending on components state.
Right now when i hover over that entire green area it changes to hover state, i want it to only activate when the "i" is hovered
If you choose the component state and go to the left menu you can hide layer you dont want
I know this is an old post but hopefully this helps someone. This same problem was driving me insane! But there is a simple solution:
Rather than using the default "Hover State" in the component create a "New State" which will function as your hover state and name it whatever you like and design the default and new states. Then, go to the Prototype tab, select the icon you want to trigger the hover animation, then add a new Interaction on the right panel. Set the Trigger to Hover, and the Destination to your new state. Works perfectly, and now you will only trigger the hover animation when hover over your icon rather than the entire component area.

How do I set a variable in separate widget class from custom button widget class in ue4 blueprint

attached are my current blueprints. i have a widget that is the level select screen, which will contain instances of a level select button. depending on which button is clicked, i want it to update a variable in the level select widget which stores the level from that particular button. I'm trying to do this so that i can add or remove levels from the selector in a modular way, as well as because there will be an option to select multiple levels played one after the other.
https://i.gyazo.com/71731a6682b186b0e1b874a80144677c.png is the button code, when clicked it will take the editor value as an int, and (when working properly) send that to the level select code which is pictured here https://i.gyazo.com/277e54770aa1a70bdab083f8b98aa714.png, selecting the proper level based on the value of variable 'selected level' when the 'proceed' button is clicked.

NSButton in Swift, handle click and release events

i'm trying to manage different state of a simple push button on an OS X application : When the user click on it, and when the user release the click.
Currently i set my button type by NSMomentaryLightButton
NSMomentaryLightButton When the button is clicked (on state), it
appears illuminated. If the button has borders, it may also appear
recessed. When the button is released, it returns to its normal (off)
state.
This type of button is best for simply triggering actions because it
doesn’t show its state; it always displays its normal image or title.
This option is called Momentary Light in Interface Builder’s Button
inspector
I thought it was the good way, but when i print my button status, it's like a toggle button than the push button that i set. As you can see on exemple gif
To sum up, How can i have a real push button behaviour ? Call function when the user click on it, and when the user release the click.
Thank,
You don't want to use buttons for piano keys. First, they are non-rectangular, and they don't act as buttons do: neither single-action push-button, nor toggle switches. You are interacting in a custom way, with a custom view, meaning the NSButton control hierarchy isn't called for. Instead you're subclassing NSView and capturing low-level mouse events as detailed here:
https://developer.apple.com/library/prerelease/content/documentation/Cocoa/Conceptual/EventOverview/HandlingMouseEvents/HandlingMouseEvents.html#//apple_ref/doc/uid/10000060i-CH6-SW1
You found this yourself as you detailed in your own comments, but I wanted to make sure you had a higher level point of view. It's even possible, and probably best, to consolidate all of the piano keys into a single view, and let the keys themselves be rendered using NSBezierPath and perform mouse hit detection using containsPoint:
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBezierPath_Class/#//apple_ref/occ/instm/NSBezierPath/containsPoint:
This is a lot more work but the only way to make a truly professional looking piano simulation. Then you can render the keys with whatever outline, fill, and labeling you need without the limitations of built-in button shapes and layout. You could even have the bottom edges of the keys slightly rounded, for example, or apply a shiny texture.

Dynamically loading multi-tab iPhone application?

Is it possible to create a multi-tab application that has a tab that will load based off a choice made at a menu in the beginning?
For example, if someone picked "tic tac toe" at the beginning menu, a "game" tab would load a tic tac toe screen instead of a chess or checkers screen.
If this is not clear, please comment.
Build the tab bar in code and then you just insert the appropriate game controller depending on what the user selects before you push the tab bar to screen.
Or
Have the users decision persisted and on loading the game tab have it query which game the user selected. `NSUserDefaults would be an easy way to persist which game was chosen.