Gmod file huds
![Mac skype connect](https://cdn3.cdnme.se/5447227/9-3/1_64e61dfaddf2b33c615a3cd3.png)
Surface.SetDrawColor ( clr ( colors.background ) ) - set background color Surface.DrawOutlinedRect ( x, y, w, h ) - draw the border Surface.SetDrawColor ( clr ( colors.border ) ) - set border draw color Lets go and fill the function up!įunction good_hud:PaintBar ( x, y, w, h, colors, value ) And the last argument - value - is going to indicate how far the bar is gone from 0 width to W width. Colors for us will be a table with four elements - border, background, fill, shade. X, Y, W and H are fairly obvious, but if you don't know what they are - X is the horizontal coordinate on the screen, Y is the vertical coordinate on the screen, W is the width, H is the height. Next, we'll make a function for drawing a bar.įunction good_hud:PaintBar ( x, y, w, h, colors, value ) end I'm going to assume that you know about gmod's file structure and where everything goes. To make the code tidy, we'll be putting every variable and function in a table, so lets start off with making the table. We are going to do it in a modular way - by making a few functions for drawing similar panels and then use those functions to draw the hud itself. Now, we are going to approach this by not slapping everything into one HUDPaint event. This tutorial is going to show you how to make a small and well laid out health and armor display. I've seen a lot of you young scripters and even some of the old ones making huds, but only a few of you make them right. This tutorial is about making heads-up-displays, or HUDs in short.
![Mac skype connect](https://cdn3.cdnme.se/5447227/9-3/1_64e61dfaddf2b33c615a3cd3.png)