Hi everyone,I use drawtexture in hud. However, something is not right when i want to draw part of texture. Maybe,I have made some mistakes?
there is the texture, i want to draw part of texture in Hud, for exmaple, a plus in file.
However nothing happened!
Who can give me some help? Very thanks!
[link text][1]
This is a problem with your Texture U/V and TextureUWidth/TextureVHeight.
Texture U/V is where in the texture should start sampling (percentage wise). So 0 means the top left while .5 would be the middle. For just drawing a normal texture fully use 0 for both.
Texture UWidth and Texture VHeight are how far (percentage wise) it samples the texture from the TextureU/TextureV positions. For the typical scenario you want these to be 1.
Example of standard draw:
If you wanted to draw only the bottom quarter of the texture you could use
TextureU=0.5
TextureV=0.5
TextureUWidth=0.5
TextureVHeight=0.5
drawing the right side of a texture would be:
TextureU=0.5
TextureV=0
TextureUWidth=0.5
TextureVHeight=1
Thanks a lot. That’s perfect!