• surface.drawtexturedrectrotated half invisible. How to?
    4 replies, posted
So ive Been fiddling around with a compass, i have a texture which is a full circle with N W S E, and i was wondering if i could cut out the bottom part so only the top part of the compass is visible. How would i go on about doing that.
Get 2 textures, one half invisible on top, one half invisible on bottom.
[QUOTE=Robotboy655;50390160]Get 2 textures, one half invisible on top, one half invisible on bottom.[/QUOTE] I don't understand how that would work in my case. Tho I might be dumb. The compass rotates the circle texture depending where the client is looking at. Here's the code for reference: [CODE] local x, y = ScrW()/2, ScrH()/2 local ang = LocalPlayer():GetAimVector():Angle().y local h, w = 200, 200 local x2, y2 = x+(w/2), y+(h/2) surface.SetDrawColor(255,255,255,150) surface.SetMaterial(Material("icons/compass_letters.png")) surface.DrawTexturedRectRotated(x2,y2,w,h,ang)[/CODE]
Try using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/SetScissorRect]render.SetScissorRect[/url] - but remember to disable it after you've used it [editline]26th May 2016[/editline] It's pretty self explanatory, but I'm not quite sure if it'd work with rotated textures... it probably would though, give it a shot
[QUOTE=MPan1;50393812]Try using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/render/SetScissorRect]render.SetScissorRect[/url] - but remember to disable it after you've used it [editline]26th May 2016[/editline] It's pretty self explanatory, but I'm not quite sure if it'd work with rotated textures... it probably would though, give it a shot[/QUOTE] Thanks a lot man, that worked out perfectly!
Sorry, you need to Log In to post a reply to this thread.