[QUOTE=Drakehawke;37391028]Can you post some more code? It looks there like you're recreating it every frame..[/QUOTE]
Oh, it's because It's in the HUD Paint hook. Where should it be?
You don't create vgui elements every frame (I shudder to think what your FPS was like), you create them once and they handle drawing themselves, to remove them you call :Remove() on it.
If I call it on 'InitPostEntity' it just stays still.
[QUOTE=Coffeee;37391223]If I call it on 'InitPostEntity' it just stays still.[/QUOTE]
Show us some code.
[QUOTE=Coffeee;37391223]If I call it on 'InitPostEntity' it just stays still.[/QUOTE]
Create it in InitPostEntity then move it in Think.
You can either use the gamemode Think hook or override the images:
[lua]
function icon_man:Think()
-- move me!
end
[/lua]
What GMod source search sites are available? I remember the one I used to use going down a while back and I haven't been able to find another one since.
In particular I'm interested in finding the source of the MatSelect method used in the material STool so I can hopefully make a material selection list for Holopad;
[lua]function TOOL.BuildCPanel( CPanel )
// HEADER
CPanel:SetTooltip( "#Tool_material_desc" )
CPanel:MatSelect( "material_override", list.Get( "OverrideMaterials" ), true, 0.33, 0.33 )
end[/lua]
glua.me/bin is the one I use, Bananas doing something with it so it's down at the moment though, it'll be back up later.
You can just use the SVN: [url]https://facepunch.svn.beanstalkapp.com/garrysmod/v12/garrysmod/[/url]
if he's doing HUD images shouldn't he use surface.* functions in HUDPaint?
[editline]24th August 2012[/editline]
[QUOTE=Splambob;37391587]What GMod source search sites are available? I remember the one I used to use going down a while back and I haven't been able to find another one since.
In particular I'm interested in finding the source of the MatSelect method used in the material STool so I can hopefully make a material selection list for Holopad;
[lua]function TOOL.BuildCPanel( CPanel )
// HEADER
CPanel:SetTooltip( "#Tool_material_desc" )
CPanel:MatSelect( "material_override", list.Get( "OverrideMaterials" ), true, 0.33, 0.33 )
end[/lua][/QUOTE]
[url]www.glua.me[/url] will be back up shortly, I'm having my host migrate the VPS to a new node that doesn't suck.
[b]EDIT:[/b]
it'll be up as soon as your DNS updates now
-nevermind, apparently Lua indices start at 1 and not at 0, and I also fucked up my Factorial function, so now everything is fixed-
glua is back fyi, it took far longer than expected >.>
Okay, I'm sure some people should fully get this. I have a hud, which has a health bar. Now, when you take damage, it goes like directly from the first number, to the second. I've tried multiple times to get it to like, count down to the current health, tho, without any luck. Would anyone direct me? I've tried using math.Approach etc. Tho, I realy don't understand what the hell I was doing.
[QUOTE=Persious;37403996]Okay, I'm sure some people should fully get this. I have a hud, which has a health bar. Now, when you take damage, it goes like directly from the first number, to the second. I've tried multiple times to get it to like, count down to the current health, tho, without any luck. Would anyone direct me? I've tried using math.Approach etc. Tho, I realy don't understand what the hell I was doing.[/QUOTE]
What I did is this. (There might be a better cleaner way.)
[lua]
FakeHealth = LocalPlayer():Health()
FakeHealth = math.Approach(FakeHealth, LocalPlayer():Health(), 0.4) --Slow health movement
Frac = FakeHealth/100
HPBar = math.Clamp(Frac,0,1)[/lua]
Then I use HPBar for my HUD.
Aha. That looks nice. I just want a working one, I dont care about the cleanest right now. Thank you!
I was wondering if anybody could help me out, my problem is on page 31. :\
[QUOTE=Drakehawke;37390895]Yeah, but then what do I do to convert from the identifier to the nice name when I want to display it?
Example:
[img]http://puu.sh/YqVa[/img][/QUOTE]
try language.GetPhrase
Hello , how to use Usermessages to display information on the screen ?
because i need to call a RP_SQL thing with a UserMessage thing ( 2 persons tell me the same thing ) but i dont know how to handle it out D:
this is the example of the gameplay ( singleplayer )
[url]http://i47.tinypic.com/2woy5om.jpg[/url]
( as you can see there's appear experience , leve, free points working perfectly on multiplayer it breaks and some people told me to send the messages with UserMessages but i dont know how , any idea :D ? )
Is there a way to draw a texture that repeats?
I thought surface.DrawTexturedRectUV was able to do something like this, but when I tried nothing drew at all.
For now I'm just using a panel and drawing a texture within in it using a loop like so.
[lua]local xrep = math.ceil( self:GetWide() / 128 )
local yrep = math.ceil( self:GetTall() / 128 )
for x = 0, xrep do
for y = 0, yrep do
surface.DrawTexturedRect( 128 * x, 128 * y, 128, 128 )
end
end[/lua]
This seems pretty hacky to me. Plus I would really like to be able to control the clipping of it, etc.
Last I checked using UV coordinates > 1 results in repeated textures.
surface.DrawTexturedRectUV(0,0,width*2,height*2,2,2) sort of thing
How would I compile a module with these includes?
[code]#include "igameevents.h"
#include "convar.h"
#include "icvar.h"[/code]
[QUOTE=boxxyy;37407839]How would I compile a module with these includes?
[code]#include "igameevents.h"
#include "convar.h"
#include "icvar.h"[/code][/QUOTE]
Hit compile??? :v:
Not quite sure what you are asking.
[QUOTE=Lexic;37407485]Last I checked using UV coordinates > 1 results in repeated textures.
surface.DrawTexturedRectUV(0,0,width*2,height*2,2,2) sort of thing[/QUOTE]
I was trying that in the beta and it wasn't working. I'll have to try it again.
[QUOTE=BlackAwps;37407854]Hit compile??? :v:
Not quite sure what you are asking.
I was trying that in the beta and it wasn't working. I'll have to try it again.[/QUOTE]
I don't have those include files; where would I find them?
^ This was my intended question.
Get the SourceSDK and create a new mod to get the source files.
[img]http://puu.sh/YORw[/img]
[QUOTE=BlackAwps;37407937]Get the SourceSDK and create a new mod to get the source files.
[img]http://puu.sh/YORw[/img][/QUOTE]
Thanks.
[B]Edit:[/B]
Should I just compile the file inside of the folder or take out the specific .h files?
[QUOTE=boxxyy;37408003]Thanks.
[B]Edit:[/B]
Should I just compile the file inside of the folder or take out the specific .h files?[/QUOTE]
You need to add the folders they're in as include directories.
[editline]26th August 2012[/editline]
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexbfe8.html#Setting_up_a_module_project_file_in_Visual_C.2B.2B[/url]
Take a look at that, don't look at the rest of the tutorial though, most of that wont work for GMod 13.
What hook are you supposed to draw IMeshes in?
Can somebody compile tmysql[B]3[/B] for Garry's mod 13?
I'm having a serious problem and all I know is that it started when I began using BlackAwps 'Object Orientated' tmysql.
I've been up all night and I'm starting to go a little batty. Whats the best way to disable the impulse 101 key for a fretta based gamemode?
[QUOTE=me-name-bob;37415462]I've been up all night and I'm starting to go a little batty. Whats the best way to disable the impulse 101 key for a fretta based gamemode?[/QUOTE]
[URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4d65.html"]This[/URL] is the hook you're looking for.
[QUOTE=brandonj4;37415480][URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4d65.html"]This[/URL] is the hook you're looking for.[/QUOTE]
You're the greatest! Thanks a million. :dance:
That won't stop people just typing impulse 101 into console though.
Why do you have sv_cheats set to 1?
Sorry, you need to Log In to post a reply to this thread.