Skip to content
/ RNDX Public

Because drawing rounded shapes should be simple, fast, and beautiful. πŸŽ‰

Notifications You must be signed in to change notification settings

Srlion/RNDX

Repository files navigation

🎨 RNDX

Draw rounded shapes with ease. RNDX is a lightweight and efficient library designed to make drawing rounded shapes simple, fast, and visually stunning.

Using Shader Model 3.0 No longer uses SM 3.0 (length/fwidth) for AA as there was a bug with some edgy cases, RNDX provides perfect anti-aliasing with no performance hit, allowing you to create beautiful interfaces and visuals with ease.

Screenshot Screenshot Screenshot


Note

Currently it only works on dev branch, it used to work on x86-64 but Rubat reverted the changes, so you can only use it on dev currently.

✨ Why RNDX?

  • Blazing Fast Performance: Optimized for speed, RNDX is incredibly lightweight and efficient. (It will get even faster once we get mat:SetFloat4()!)
  • Perfect Anti-Aliasing: Enjoy smooth, pixel-perfect corners with no performance hit.
  • Simple & Intuitive: No complex objects or statesβ€”just call a function and draw!
  • Seamless Integration: Works flawlessly inside 3D2D and Panel:Paint* functions without any hacks.

πŸ› οΈ Get Started

Note

Currently it only works on dev branch, it used to work on x86-64 but Rubat reverted the changes, so you can only use it on dev currently.

  1. Download RNDX.tar.gz & rndx.lua from GitHub releases.
  2. Add the content of RNDX.tar.gz to your gmod client garrysmod folder. (Temporarily until we get thirdparty support!)
  3. AddCSLuaFile & include rndx.lua.
  4. VoilΓ ! You're ready to draw rounded shapes with ease. πŸŽ‰

πŸ“ Usage

hook.Add("HUDPaint", "RNDX Example", function()
    local flags = RNDX.NO_TL + RNDX.NO_TR + RNDX.SHAPE_IOS
    RNDX.Draw(10, 100, 100, 200, 200, nil, flags + RNDX.BLUR)
    RNDX.Draw(10, 100, 100, 200, 200, Color(255, 0, 0, 150), flags)
    RNDX.DrawOutlined(10, 100, 100, 200, 200, Color(0, 255, 0), 10, flags)
end)

πŸ“š Documentation

Flags

  • RNDX.NO_TL: Disables top-left corner.
  • RNDX.NO_TR: Disables top-right corner.
  • RNDX.NO_BL: Disables bottom-left corner.
  • RNDX.NO_BR: Disables bottom-right corner.
  • RNDX.BLUR: Use blur for the shape.

  • RNDX.SHAPE_CIRCLE
  • RNDX.SHAPE_FIGMA <-- Default
  • RNDX.SHAPE_IOS

Screenshot


Functions

RNDX.Draw(rad, x, y, w, h, col, flags)

RNDX.DrawOutlined(rad, x, y, w, h, col, thickness, flags)

RNDX.DrawTexture(rad, x, y, w, h, col, texture, flags)

RNDX.DrawMaterial(rad, x, y, w, h, col, mat, flags)

RNDX.DrawCircle(x, y, r, col, flags) <-- Just a wrapper for RNDX.Draw with RNDX.SHAPE_CIRCLE.

RNDX.DrawCircle(x, y, r, col, thickness, flags)


πŸš€ Why Choose RNDX Over Alternatives?

Feature RNDX Circles paint melonstuff
Speed ⚑ Extremely Fast 🐌 Slow with many circles ⚑ Fast 🐌 Slow
Anti-Aliasing βœ… Perfect, no performance cost ❌ None ❌ Poor (Source Engine AA) ❌ None
Ease of Use 🎯 Simple & Minimal 🎯 Simple 🧩 Complex & Bloated 🎯 Easy
Documentation πŸ“– Clear & Concise πŸ“– Good ❌ Overwhelming & Undocumented πŸ“– Good

πŸ“œ License

RNDX is open-source and free to use. Feel free to contribute or report issues on GitHub!

Make sure to give credits!


🌟 Credits

RNDX: Because drawing rounded shapes should be simple, fast, and beautiful. πŸŽ‰