Skip to content
Spell Renderer

Quick rating

Community listing page, reviews may not be monitored by the author.

Spell Renderer

By getharlikOwner

No reviews yet

A fast, lightweight OpenGL wrapper for Minecraft, designed for rendering 2D objects with a clean, fluent API.

Mod Loaders
Minecraft

About

Description

✨ Spell Renderer

Modern 2D UI rendering for Fabric mods: rounded panels, liquid glass, crisp text and draggable HUDs, all from one fluent API.

Preview

Building a good-looking interface in Minecraft usually means fighting with GuiGraphics or writing raw OpenGL yourself. Spell Renderer gives you a small, chainable builder instead. You describe a shape and call .submit(), and the library takes care of shaders, batching, scaling and clipping.

📦 This is a library mod. On its own it adds nothing to the game. Install it if another mod needs it, or use it to build your own UI.


🎨 What you can draw

Shape What it's for
Rectangle Panels and buttons with rounded corners, a different radius per corner, and gradient colors
Circle Dots, indicators, avatars
Image Textures with optional rounded corners
Text Sharp text at any size, using MSDF fonts
Icon Named icons from your own icon fonts, e.g. Builder.icon("settings")
Glass Frosted or liquid glass panels with adjustable blur, refraction and more

🧊 New: liquid glass

Glass panels have been rebuilt from the ground up. Each panel has its own settings:

  • Blur. From barely there to heavily frosted, and every radius costs the same, so heavy blur doesn't slow your UI down.
  • Refraction. Edges bend the background like a lens, for the liquid-glass look. Set it to 0 for flat frosted glass.
  • Chromatic split. A subtle RGB fringe along the edges.
  • Saturation. Make the background behind the glass more vivid, or turn it grayscale.
  • Highlight. A thin rim of light along the edge.
Builder.glass()
        .pos(20, 20)
        .size(200, 120)
        .radius(16)
        .blur(16)
        .refraction(0.9f)
        .chromatic(4)
        .saturation(1.4f)
        .highlight(0.3f)
        .submit();

Glass now looks the same at every UI scale, and stacking glass on glass works as you'd expect.

⚡ Features

  • 🔗 Fluent builder. Position, size, color, round and fade a shape in one readable chain.
  • 🖱️ Draggable shapes. Add .draggable("id") to a shape and players can move it with the mouse. Its children move with it, it can't leave the screen, and its position can be saved and restored.
  • 👪 Parenting. Attach shapes to a parent and they follow its position, depth and opacity.
  • 🚀 Batched rendering. Shapes of the same type are drawn together in one draw call.
  • 🔤 MSDF text. Text stays sharp at any scale and any GUI size.
  • ✂️ Scissors. Clip drawing to a region, which is handy for scroll lists and masked panels.
  • 🔍 Scaling. Scale your whole UI independently of Minecraft's GUI scale.
  • 🧭 Render contexts. Draw on the HUD during gameplay or on the GUI layer above every screen. (World rendering is in development.)

🧑‍💻 How it looks in code

SpellRenderer.on(RenderContext.HUD, () -> {
    var panel = Builder.rect()
            .pos(20, 20)
            .size(220, 80)
            .radius(12)
            .color(new Color(30, 30, 40))
            .draggable("my-panel");   // players can move it while chat is open
    panel.submit();

    Builder.text("Hello, Spell!")
            .pos(12, 12)
            .size(24)
            .parent(panel)            // moves together with the panel
            .submit();
});

📥 Getting started

Add it from the Modrinth Maven:

repositories {
    maven { url = "https://api.modrinth.com/maven" }
}

dependencies {
    modImplementation "maven.modrinth:spell-renderer:<version>"
    include "maven.modrinth:spell-renderer:<version>" // optional: bundle it inside your mod
}

Maven setup, adding fonts and icons, and the full API are in the documentation on GitHub.

📋 Requirements

  • Minecraft 1.21.8
  • Fabric Loader 0.18.5+
  • Fabric API
  • Java 21

💬 Found a bug or have an idea?

Open an issue on GitHub. Feedback and contributions are welcome!