HELP: Hud Compass Element - using a flat 'NOT rotating' texture
5 replies, posted
I am trying to create a compass such as the ones used in the call of duty games. It is a flat image that is cut off at each end by a mask or some other means.
Here is an example on a call of duty 4 mini-map, please note the compass along the top of the image:
[img]http://www.progaming-tips.com/images/MiniMap.jpg[/img]
So I have the textures and the surface. commands already implemented in the .lua file, and I have it drawing the angles and everything correctly, but I have a HUGE problem.
The texture is not clipped, masked, or cut off in the spots I want it to be. surface.DrawTexturedRect and surface.DrawTexturedRectUV are the only commands I know that can allow a textured poly on the UI, and these don't clip the way I need it to.
Is there a way to assign your texture to a surface.DrawTexturedRectUV and then set a texture heigh, width, and an offset to where the texture is aligned to within the bounding box?
surface.DrawTexturedRectRotated( Number x, Number y, Number width, Number height, Number rotation )
[QUOTE=Chessnut;36058688]surface.DrawTexturedRectRotated( Number x, Number y, Number width, Number height, Number rotation )[/QUOTE]
I specifically said it is not a rotation I need, it's a flat image that moves on the x plane left to right and is clipped on the sides.
I heard you can use [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index54c2.html?title=Render.SetScissorRect[/url] within a render target to clip gui/hud stuff.
[QUOTE=dylanb5123;36059306]I heard you can use [url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index54c2.html?title=Render.SetScissorRect[/url] within a render target to clip gui/hud stuff.[/QUOTE]
Thanks, that works.
[QUOTE=Kronophonix;36059843]Thanks, that works.[/QUOTE]
You're welcome
Sorry, you need to Log In to post a reply to this thread.