Where is the HUD defined in the strategy example game?
I'm just getting started and I'm having some basic problems with understanding how to find things in the editor.
I'm trying to look at the strategy game (tower defense) example to see how it works. I can't find the HUD. In the Content Examples project, there's an actual blueprint that has the HUD functionality in it. But I can't find any HUD-related blueprint or class anywhere in tower defense. The level blueprint calls a function named "Show Wave Title" that I assume does something to the HUD, but I can't figure out where that function is defined or what it does.
I feel like I'm missing something obvious. Can someone point me in the right direction? I've read through much of the documentation and tutorials, but I guess I missed something important.
asked Apr 10 '14 at 07:50 AM in Using UE4
Checking out the official description of the sample will hint at where to find the code. And it is in the code, which may not be totally obvious. I like to think it's not obvious because i dug around in the editor for quite a while trying to figure out where all the logic is. The truth is that the strategy sample is a hybrid blueprint/c++ project and a lot of the heavy lifting is in c++.
So the answer is in the code. You can find it on Windows in something like /my documents/unreal projects/strategygame. On mac its /Documents/Unreal Projects/StragetyGame. Right click on the StrategyGame.uproject file and choose the generate files for xcode or visual studio option ( look here ).
Now you can open up the code in your IDE. Look into StrategyGame/Source/StrategyGame/Classes/UI for the headers and <...>/Private/UI for the implementation.
If you want to see the build HUD code, find AStrategyBuilding::OnInputTap_Implementation() and you'll see that it will flow into AStrategyBuilding::ShowActionMenu() to show the building menus.
For the rest of the stuff, you have to figure out the code in the UI folder I believe. That's one of my remaining parts to figure out re: this example.
Hope this helps!
answered Apr 10 '14 at 08:43 PM
Try going to Blueprints icon and from the roll-down for the loaded strategy project, supposing the right map is open, choose GameMode and look at its defaults, where there should be HUD info you can check out.
[Edit - oops, that's normally how but it looks like in this project the HUD's done in Slate. In the content browser if you search 'strategy' you'll see DefaultStrategyHUDStyle and DefaultStrategyMenuStyle; these point to assets like textures used in the game. I don't know how to set up slate though ... but it's possible to view the defaults. Also look up MiniMapCapture.]
Follow this question
Once you sign in you will be able to subscribe for any updates here