• Using different shapes in HUDS.
    2 replies, posted
Hello, Ive seen HUDS before that use custom shapes or diagonal rectangles like so: [url]http://i.imgur.com/EbLBENL.jpg[/url] How can I achieve this? Im not sure how?
[url]http://wiki.garrysmod.com/page/surface/DrawPoly[/url]
Creating huds: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/proper_hud_creation.lua.html[/url] Creating shapes with poly ( just like connect the dots ): [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/poly/creating_shapes_using_poly.lua.html[/url] Tilted rectangle as healthbar ( read original thread and compare vs code in tutorial to learn about simplifying problems ): [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/poly/tilted_rectangle_poly_as_health_meter.lua.html[/url] Another tilted: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/poly/another_tilted_health_bar.lua.html[/url] Circles: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/poly/simplified_circles_with_poly.lua.html[/url] If you see some of my tutorials, you'll see that polys are generated OUTSIDE of HUDPaint. Instead of re-creating the poly each and every frame, you can generate it ONCE and update it when the player resolution changes. Here's an example of how to create a hook ( this one works ) to call PlayerChangedResolution with new/old width/height vars: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_hooks/acecool_hook_playerchangedresolution/gm_playerchangedresolution.lua[/url] Example usage: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_hooks/acecool_hook_playerchangedresolution/example_usage.lua[/url] [b]Hopefully these tutorials and information helps. As always, to view the Lua from any of my tutorials to enable copy/pasting ( HTML doesn't copy/paste well in terms of HTML / CSS Highlighted Lua ), remove .html from the url.[/b]
Sorry, you need to Log In to post a reply to this thread.