Draw text to hud with shootergame hud

Hi guys. So am using the shootergame hud. I have created a new blueprint and referenced it to the shootergame hud class. Than I went into the blueprints and created a draw to text. However my text is not showing up. Hoping someone can tell me what I am doing wrong??!! Any ideas would be great.

Your blueprint is only missing the proper location/size of what to draw. You need to make use of the “Size X and Y” nodes from the draw HUD event. First divide Size X and Y by 2 (can be tweaked as needed but 2 is a good starting point), The division node affects the overall size of the text. Then you need to multiply the two outputs (size x after division and size y after division, also requires a quick conversion of int to float) by 0.984, and plug them into the Screen X and Y pins of the Draw Text node. Multiplying each by 0.984 is a tweaking number that adjusts the position of text. For example, multiplying ‘X’ and ‘Y’ by 0.984 will place the origin of the text in the middle of the screen; if you were to multiply ‘Y’ by 0.3 or so instead, you would see the text’s origin roughly at the top center of your screen.

(note: text origin starts in the bottom left hand corner of the first letter, not in the middle of the word/sentence)

Hope this helps,

What are the 3 boxes below called. The one with the light green and the very cool light bluish. Can’t figure that out. Thanks!

Generally you can just drag a line between the two nodes and those boxes automatically get implemented. In the event that they don’t (not all are automatic), Light Green designates a float variable (aka a number like 13.37652) and the light blue indicates a integer (like 13 or 14); so, the node you are looking for is “int to float” conversion node. On a side note there are many other types of nodes like this like “float to string” or “string to Boolean” etc. They use different number types in programming like this for memory reasons (I.e. You don’t need a decimal point to count how many times a player dies, they can’t die 13.46 times). There’s also other reasons but you can look that up. Hope that helps.

Thanks what is the first node on the right coming out of screen Y called from draw text?

This is what I have right now. Again keep in mind I went into world classviewer got the shooterhud so Hud2 is reading off of shooterhud if I am understanding that correctly. I know something is wrong here because its not working. Sorry for all this. Consider me a noob when it comes to blueprints.

Do you mean the multiply float by integer node (float * int) in your picture? The one I use in my picture is divide integer by integer (int/int). I then converted the integer output into a float and multiplied that by a float. You are probably drawing “eatmenow” wayyyyy far off the screen if the blueprint runs without errors. Try dividing screen x and y by 2 first using a divide int by int node, then convert int to float for x and y, then multiply both float numbers by 0.984. This will put “eatmenow” in the middle of your screen. You can adjust 0.984 numbers to something else to move it around your screen.

Ehh am more than lost now. It’s not your fault. I simply don’t understand this yet. I should be able to figure it out from here.

Thank you!

Ahh my bad, I drew some pictures that might help.

Yeah I can do one where I go step by step today. It’ll have to be when I get off work though (no mic or fraps). I’ll post a youtube link here later today (recording + compressing + uploading will take some time).

Is their anyway we can get a video tutorial? I really do appreciate all your help.

I really do appreciate all your help.

So this is what I have set up is this correct?

That would be amazing thank you so much!

Yes all the nodes are in place, just connect the boxes as I have drawn below. Also, if this doesn’t work then your game probably doesn’t know to use this HUD blueprint. So, you have to select your HUD blueprint in the world settings(image below).

Thats the thing with using the shootergame as a base code we have built all are code on top of that I cannot change the hud from shooterhud to anything else. IT will not allow me too. Is their another way around this?

Jason

That is the thing. I have to keep it at shootergame because all are coding and blueprints is built on top of the shootergame itself. When I change the mode from shootergame nothing works. So is their a way I can something that will allow the hud to change?

Step 1.) Open up the blueprint section in the content browser

Step 2.) Right click on empty space and create a new blueprint. Choose Game Mode as the blueprint type.

Step 3.) Name it whatever you want, I’m going to call it MyGameMode for teaching purposes.

Step 4.) Open up the blueprint, click on the default tab in the top right-ish area.

Step 5.) You should see like 5 drop down menus for things like HUD. You can now choose all the settings you’d like.

Step 6.) Go to world settings, and choose your custom game mode as the game mode. You should be good now :).

Oh I see now, yeah their shootergame mode (Hud, etc) isn’t made with blueprints sadly; so, you will have to make edits to it in the code (I have no experience with this currently) or create your own and base your stuff off it instead (yeah that might take a bit of time to fix). Sorry bud, I can’t really help much past that.

Hey ,

you are amazing, with your help I can move forward with my project! Nice one!

Thanks :slight_smile:

you should accept fenras answer, he put alot of effort in it besides from beeing correct.