Page 1 of 1

Adding text to the HUD? [Solved]

Posted: Tue Sep 26, 2017 12:35 am
by CdtFox
Hey guys,

Quick question how can i add new text to the HUD?; in the HUD file itself all my new parameters are ok (positions, Text, event enable). My new text is fully localized.

I created one more Text line like this: Text("player1weapon1ammo") and i'm pretty sure this is where the problem is. Everything is under the Group("player1reticule").

Can we create custom entry? I wasn't able to find something about ("player1weapon1overheat") in the modtool for exemple.

I also tried some hit maker text, it's isn't working too:
Hidden/Spoiler:
[code]
}[/code]
Thanks for reading :D

Re: Adding text to the HUD?

Posted: Tue Sep 26, 2017 6:54 am
by Anakin
of course you can create your own entry.
First of all you should try to get something on the screen. So don't care about the text or when it does appear.

Start with something simple such as

Code: Select all

Text("test")
{
    TextBreak("Word")
    TextStyle("Shadow")
    Text("Hello World")
    TextAlignment("Center", "Top")
    TextFont("gamefont_medium")
    Position(0.500000, 0.750000, 0.000000, "Viewport")
    ZOrder(5)
    Color(230, 70, 0)
}
If you see it on the screen, you should move it somewhere you can see it very good (middle of the screen) and don't make it too tiny. Make it a Hugh size, so you can still see it even when it moves out of the window.

next try to get you event enable working,

and then you can move it to your group you want it to be. Remember that you always inherit the position and offset things from your parent. So if your object is at the position 0,0 and your parent you move it to has something like 5,5 make sure you change the value of your own object to -5,-5.

After all that is working continue with the text itself and fill it with something you really wanna display

Now is the time to resize the text and move it to it's final position

And Now you can do some fancy effects such as the Color, fading,...

Good luck

Re: Adding text to the HUD?

Posted: Wed Sep 27, 2017 1:28 am
by CdtFox
Yep thanks for the answer, i'v done step by step like you said and now everything is working perfectly :D

Re: Adding text to the HUD? [Solved]

Posted: Wed Sep 27, 2017 4:15 am
by Anakin
:thumbs: it's a general mistake. Everyone has great ideas but never did something like that. So you should always concentrate on the basics first (functionality) and go over to advanced things and decorations later (content and design)