Cool, this gona be better then trying to figure out the X Y and stuff on the adv hud =D
great job btw
Hey, I saw a few threads asking for HUD Drawing functions for the E2. I haven't spent that much time working on it so ill just throw this out and see what you guys think. Just extract to your addons.
Index is which text you are creating/deleting.Code:X Y Width Height automatically default to percents of your screen hudDrawText(Index(N),Text(S),X(N),Y(N),Color(V),Alpha(N),Align(N),Size(N)) hudDrawRBox(Index(N),BorderSize(N),X(N),Y(N),Width(N),Height(N),Color(V),Alpha(N)) hudDrawRect(Index(N),X(N),Y(N),Width(N),Height(N),Color(V),Alpha(N)) hudDrawLine(Index(N),StartX(N),StartY(N),EndX(N),EndY(N),Color(V),Alpha(N)) E:hudDrawText(Index(N),Text(S),X(N),Y(N),Color(V),Alpha(N),Align(N),Size(N)) E:hudDrawRBox(Index(N),BorderSize(N),X(N),Y(N),Width(N),Height(N),Color(V),Alpha(N)) E:hudDrawRect(Index(N),X(N),Y(N),Width(N),Height(N),Color(V),Alpha(N)) E:hudDrawLine(Index(N),StartX(N),StartY(N),EndX(N),EndY(N),Color(V),Alpha(N)) X Y Width Height default to pixels hudDrawTextPixels(Index(N),Text(S),X(N),Y(N),Color(V),Alpha(N),Align(N),Size(N)) hudDrawRBoxPixels(Index(N),BorderSize(N),X(N),Y(N),Width(N),Height(N),Color(V),Alpha(N)) hudDrawRectPixels(Index(N),X(N),Y(N),Width(N),Height(N),Color(V),Alpha(N)) hudDrawLinePixels(Index(N),StartX(N),StartY(N),EndX(N),EndY(N),Color(V),Alpha(N)) E:hudDrawTextPixels(Index(N),Text(S),X(N),Y(N),Color(V),Alpha(N),Align(N),Size(N)) E:hudDrawRBoxPixels(Index(N),BorderSize(N),X(N),Y(N),Width(N),Height(N),Color(V),Alpha(N)) E:hudDrawRectPixels(Index(N),X(N),Y(N),Width(N),Height(N),Color(V),Alpha(N)) E:hudDrawLinePixels(Index(N),StartX(N),StartY(N),EndX(N),EndY(N),Color(V),Alpha(N)) hudDrawPoly goes from 3 vertexes to 16 hudDrawPoly(Index(N),Vertex1(vec2),Vertex2(vec2),Vertex3(vec2),Color(V),Alpha(N) hudDrawPolyPixels(Index(N),Vertex1(vec2),Vertex2(vec2),Vertex3(vec2),Color(V),Alpha(N) E:hudDrawPoly(Index(N),Vertex1(vec2),Vertex2(vec2),Vertex3(vec2),Color(V),Alpha(N) E:hudDrawPolyPixels(Index(N),Vertex1(vec2),Vertex2(vec2),Vertex3(vec2),Color(V),Alpha(N) hudRemoveElement(Index(N)) E:hudRemoveElement(Index(N)) hudClear() E:hudClear()
Text is the text displayed.
X is the X coordinate on your screen.
Y is the Y coordinate on your screen.
Color is the Color of the text in a vector (X Y Z is R G B respectively).
Alpha is the Alpha of the text (transparency).
Align is how the text is aligned next to the X and Y coordinates.
Size is the Size of the text (1 ~ 15, 1 being smallest)Code:1. TEXT_ALIGN_LEFT = 0 2. TEXT_ALIGN_CENTER = 1 3. TEXT_ALIGN_RIGHT = 2 4. TEXT_ALIGN_TOP = 3 5. TEXT_ALIGN_BOTTOM = 4
Enjoy and if you have any questions, bugs, or suggestions please PM me.
IF YOUR UPDATING. MAKE SURE TO REMOVE ALL PREVIOUS VERSIONS!
BIG CHANGES!
POLYGONS NOW AVAILABLE AS WELL AS DRAWING ON PLAYERS IN VEHICLES! If you have the vehicle entity just make sure to get the driver by doing Vehicle:driver():draw... All Elements are stored in 1 table so if you draw text at index 1 and then a poly at index 1 it will overwrite the text. Also the higher the index the higher the draw order. So things at higher indexes will draw on TOP of elements at lower indexes. If there are any bugs and I'm sure there will be please PM me or post a response on this thread.
For the first second after the E2 is spawned you can create 30 HUD elements after that you can create 15 per second.
Last edited by McLovin; 07-20-2009 at 12:00 AM.
Anticept - HP you are terrible at trolling. Always have been. Leave it up to the pros like Jat.
Black Phoenix - Actually cunt goes into bullshit. Bullshit does not fit in cunt.
Drunkie - Logically, Jat Goodwin must be a fist pumping guido.
So the syntax is drawText(N,S,N,V,N,N,N)?
yes
Code:drawText(N,S,N,N,V,N,N,N)
Anticept - HP you are terrible at trolling. Always have been. Leave it up to the pros like Jat.
Black Phoenix - Actually cunt goes into bullshit. Bullshit does not fit in cunt.
Drunkie - Logically, Jat Goodwin must be a fist pumping guido.
No support to show it on someone else's screen? Just the owner?
That's alright, but a little limiting. Guess it could be used for a personal contraption, but definitely not public usage.
would you want someone spamming letters on your screen? i was thinking of making derma pop up asking the client if they would like to accept it but im not sure if this will be used enough.
Anticept - HP you are terrible at trolling. Always have been. Leave it up to the pros like Jat.
Black Phoenix - Actually cunt goes into bullshit. Bullshit does not fit in cunt.
Drunkie - Logically, Jat Goodwin must be a fist pumping guido.
I'm adding some Derma for people so they can decide if they want you to draw on their HUD.
Anticept - HP you are terrible at trolling. Always have been. Leave it up to the pros like Jat.
Black Phoenix - Actually cunt goes into bullshit. Bullshit does not fit in cunt.
Drunkie - Logically, Jat Goodwin must be a fist pumping guido.
This is very cool. Another nice feature to have in this would be the ability to draw at a specific point in space, given the vector of that point. This could be done with the Vector:ToScreen( ) function which returns a table with elements "x", "y" and "visible". Unfortunately, this is client only so it will need to be done on the client side. Great work on the function though.![]()
Awesome![]()
The Olympus Technologies drones, totally not SkyNet in Gmod form.
Cronus: The Ultimate Drone, definitely SkyNet in Gmod form.
The gBrain Project, the drone controls system that thinks it's better than you
Anticept - HP you are terrible at trolling. Always have been. Leave it up to the pros like Jat.
Black Phoenix - Actually cunt goes into bullshit. Bullshit does not fit in cunt.
Drunkie - Logically, Jat Goodwin must be a fist pumping guido.
Bookmarks