Author Topic: setting textures sizes for hud(lua)  (Read 3349 times)

Offline Inv??Gir

  • Gold Member
  • *
  • Posts: 186
  • Awards [OCRP Award] Secret Phrase [OCRP Award] Evo City Half Marathon [OCRP Award] Social Player [OCRP Award] Comrades
    • View Profile
    • Awards
setting textures sizes for hud(lua)
« on: January 23, 2012, 12:49:50 PM »
i want to make my own hud and i never knew how to make one with textures untill now
i've been downloading a few hud's from gmod.org and tested them and checked the lua files + textures files and i saw that the original base hud have a small hp bar and the second texutre size is bigger then the base
when i checked the lua files i saw you cant set the texture size only the position
so my question is how its works like this and how to set my own hp bar to be exactly at the same size of the base one
i allready made the hud but i dont want to to the same work twice so plesae help me:(

and thanks for all the helpers ;D
« Last Edit: January 23, 2012, 12:51:48 PM by InvaGir:D »

Offline [RG-O] jamiecross5

  • Gold Member
  • *
  • Posts: 104
    • View Profile
    • Awards
Re: setting textures sizes for hud(lua)
« Reply #1 on: January 23, 2012, 01:13:07 PM »
Its easy Its just one small code, Why a HUD? they are verry newbie lua.
This photo is cursed.












Offline TOMASAS

  • da best xd
  • Gold Member
  • *
  • Posts: 802
  • Awards [OCRP Award] Millionaire [OCRP Award] Secret Phrase [OCRP Award] Social Player [OCRP Award] Owner Party
    • View Profile
    • Awards
Re: setting textures sizes for hud(lua)
« Reply #2 on: January 23, 2012, 01:17:07 PM »
surface.DrawTexturedRect( Number x, Number y, Number width, Number height )

So the first argument is the X position, the second argument is the Y position, the third argument is the Width of the picture and the fourth is the Height of the picture. It's pretty simple.

Also you might want to check out http://wiki.garrysmod.com/?title=Main_Page if you haven't already. Use the search function to search for functions you need help on.
Stop assuming things.

bitcoin: 1Fq4EFYLwvktC3uKM6d6qu8irSwepqigAX

Offline Inv??Gir

  • Gold Member
  • *
  • Posts: 186
  • Awards [OCRP Award] Secret Phrase [OCRP Award] Evo City Half Marathon [OCRP Award] Social Player [OCRP Award] Comrades
    • View Profile
    • Awards
Re: setting textures sizes for hud(lua)
« Reply #3 on: January 23, 2012, 01:22:32 PM »
oh thanks:)

and  jamiecross im doin it for my self not to advertise it

Offline wag1

  • somalian dry
  • Gold Member
  • *
  • Posts: 1,184
  • Awards [OCRP Award] Secret Phrase [OCRP Award] Evo City Half Marathon [OCRP Award] Social Player [OCRP Award] Comrades
    • View Profile
    • Awards
Re: setting textures sizes for hud(lua)
« Reply #4 on: January 24, 2012, 03:54:19 PM »
Alright, problem solved. Locking the topic.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal