• Fade out texture
    4 replies, posted
How to fade out textures in HUDPaint? surface.SetDrawColor has no effect unless the alpha value is 0.
[QUOTE=Al Capone;35329962]How to fade out textures in HUDPaint? surface.SetDrawColor has no effect unless the alpha value is 0.[/QUOTE] Hmm, are you sure the alpha is that sensitive? Perhaps the range is [0,100] or [0,1). Though I was working on a HUD last night and I seemed to get good results with greater-than-zero values, however, I was drawing a primitive shape with a fill. I presume you are probably drawing a texture, right? If so, check out this link - it explains a problem similar to what you are experiencing: [URL="http://facepunch.com/threads/1000478?p=24926442&viewfull=1#post24926442"]surface.setDrawColor() doesn't affect surface.DrawTexturedRect?[/URL]
Texture probably needs $vertexalpha 1
Thanks. I am currently using surface.DrawTexturedRect to draw one of the default blood textures. Changing the value range does not help. Do I really have to create my own texture with $vertexalpha 1 to be able to change the alpha value?
[QUOTE=Al Capone;35331129]Thanks. I am currently using surface.DrawTexturedRect to draw one of the default blood textures. Changing the value range does not help. Do I really have to create my own texture with $vertexalpha 1 to be able to change the alpha value?[/QUOTE] In the source engine, each texture has two files associated - The [B]vtf[/B] which is basically the actual texture itself, and the [B]vmt[/B] which is a file that [I]describes[/I] the texture, using code. It specifies how that texture is loaded, what pixel shaders are used, etc. To change the alpha, you will have to edit the [B][URL="https://developer.valvesoftware.com/wiki/Material"]vmt[/URL][/B] file, which is really simple. You can open it in notepad, notepad++, etc. It is just plaintext. The vmt file will be of the same name as the texture file itself, so finding it should be easy. If you look at the page I linked you to and then take a look at one of the VMT files, I think you will see what I mean. It shouldn't be too difficult. Good luck!
Sorry, you need to Log In to post a reply to this thread.