+ Reply to Thread
Page 1 of 13 12311 ... LastLast
Results 1 to 10 of 122

Thread: [E2] HUD Rendering

  1. #1
    ◕␣◕ McLovin's Avatar
    Join Date
    Sep 2008
    Location
    Batman, Turkey
    Posts
    2,345
    Blog Entries
    3

    Cool [E2] HUD Rendering

    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.

    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()
    Index is which text you are creating/deleting.
    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.

    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
    Size is the Size of the text (1 ~ 15, 1 being smallest)

    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.
    Attached Files Attached Files
    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.

  2. #2
    Wirererer cakeguy's Avatar
    Join Date
    Feb 2009
    Posts
    146

    Default re: [E2] HUD Rendering

    Cool, this gona be better then trying to figure out the X Y and stuff on the adv hud =D
    great job btw

  3. #3
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default re: [E2] HUD Rendering

    So the syntax is drawText(N,S,N,V,N,N,N)?

  4. #4
    ◕␣◕ McLovin's Avatar
    Join Date
    Sep 2008
    Location
    Batman, Turkey
    Posts
    2,345
    Blog Entries
    3

    Default re: [E2] HUD Rendering

    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.

  5. #5
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default re: [E2] HUD Rendering

    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.

  6. #6
    ◕␣◕ McLovin's Avatar
    Join Date
    Sep 2008
    Location
    Batman, Turkey
    Posts
    2,345
    Blog Entries
    3

    Default re: [E2] HUD Rendering

    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.

  7. #7
    ◕␣◕ McLovin's Avatar
    Join Date
    Sep 2008
    Location
    Batman, Turkey
    Posts
    2,345
    Blog Entries
    3

    Default re: [E2] HUD Rendering

    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.

  8. #8
    Wirererer Jeremydeath's Avatar
    Join Date
    Jun 2008
    Location
    Texas, USA
    Posts
    383

    Default re: [E2] HUD Rendering

    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.

  9. #9
    Wiremod Helper Lyinginbedmon's Avatar
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,659

    Default re: [E2] HUD Rendering

    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

  10. #10
    ◕␣◕ McLovin's Avatar
    Join Date
    Sep 2008
    Location
    Batman, Turkey
    Posts
    2,345
    Blog Entries
    3

    Default re: [E2] HUD Rendering

    Quote Originally Posted by Jeremydeath View Post
    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.
    The draw functions im using are also clientside... could you PM me with more details with the ToScreen( ) function, ill add it if i can it sounds cool
    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.

+ Reply to Thread
Page 1 of 13 12311 ... LastLast

LinkBacks (?)

  1. 07-08-2010, 10:13 AM

Similar Threads

  1. E2 hud drawing
    By Riddler in forum Expression 2 Discussion & Help
    Replies: 12
    Last Post: 01-30-2010, 04:59 AM
  2. E2 HUD drawing extension
    By Beer in forum Ideas & Suggestions
    Replies: 3
    Last Post: 03-30-2009, 07:28 PM
  3. [E2] HUD-drawing functions
    By SatansSimon in forum Wiremod Addons & Coding
    Replies: 23
    Last Post: 03-22-2009, 03:15 PM
  4. Pamento - Gpu For Drawing
    By Hitman271 in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 7
    Last Post: 12-29-2008, 12:26 PM
  5. Drawing pad
    By Beer in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 04-24-2008, 06:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots