Ulysses

General => Developers Corner => Topic started by: Valgoid on July 11, 2014, 10:27:54 PM

Title: Quick Question About HUD
Post by: Valgoid on July 11, 2014, 10:27:54 PM
For my server I want it to display my server name on the top left hand corner of the players screens.

Can anyone help me with this?
Title: Re: Quick Question About HUD
Post by: Avoid on July 12, 2014, 06:24:46 AM
Hey there,
try using this:

Code: [Select]
draw.DrawText( GetHostName( ), "Default", x, y * 0.01, Color( 255, 255, 255, 120 ), TEXT_ALIGN_LEFT );

Avoid
Title: Re: Quick Question About HUD
Post by: Valgoid on July 12, 2014, 09:01:40 AM
That looks good, but what if we wanted to out an outline, so the text is white and outline is grey, you k ow what i mean so it looks better
Title: Re: Quick Question About HUD
Post by: Cobalt on July 12, 2014, 10:55:04 AM
draw.SimpleTextOutlined( GetHostName(), "Trebuchet24", 5, 5, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP, 1, color_black )
Title: Re: Quick Question About HUD
Post by: JamminR on July 12, 2014, 02:04:13 PM
Valgoid, in case you're not already when these two are showing you the actual code, you should really look up the functions they're showing you, so you know what the info inside them mean, using the Gmod wiki.
draw.DrawText (http://wiki.garrysmod.com/page/draw/DrawText)
draw.SimpleTextOutlined (http://wiki.garrysmod.com/page/draw/SimpleTextOutlined)
Title: Re: Quick Question About HUD
Post by: Valgoid on July 14, 2014, 12:33:10 PM
I cant get it to work...
Title: Re: Quick Question About HUD
Post by: Avoid on July 14, 2014, 01:14:24 PM
Hello,
that is not much of an explanation for your problem..Where exactly are you stuck?
Try adding the line Cobalt posted in a clientsided file, preferably in the HUDPaint section! :)

Avoid
Title: Re: Quick Question About HUD
Post by: Valgoid on July 17, 2014, 12:17:39 PM
I'm very confused, can you please write the whole script out? I honestly dont know whats going on.
Title: Re: Quick Question About HUD
Post by: Neku on July 17, 2014, 12:48:11 PM
I'm very confused, can you please write the whole script out? I honestly dont know whats going on.

Sorry, but that just makes me suspicious of you. Do you really know lua?
Title: Re: Quick Question About HUD
Post by: Valgoid on July 24, 2014, 10:10:11 PM
Very basic lua, yes but for some reason this script isnt working