Skip to content

Repository files navigation

GuilRender.mp4

GuilRender

A collection of rendering tools I built while developing my UI framework, organized into their own repo since the UI depends on them directly, meaning they'll get all the maintenance they deserve. Feel free to use them!


What's Inside

GuilBatch.cs: Custom Sprite & Shape Batcher

A rendering class built around aggressive batching, Everything from clipping, gradients to shape data is baked directly into the vertices, keeping draw calls minimal while minimizing vertex bloat.

Supports:

  • Rectangles, Lines, Circles, Arcs, Ellipses
  • Textures
  • Gradients (baked into vertices)
  • Clipping (baked into vertices)

GuilFont.cs: Bitmap Multi-Atlas Font Renderer

Renders fonts pre-generated by the included Python tool (a GUI tool, not CLI). Any .ttf can be converted into a .guif file, which pre-bakes the font across multiple sizes using pygame's font rendering engine. At runtime, GuilFont picks the closest atlas size and scales to the exact height you need.

Features:

  • Multi-atlas automatic size selection & scaling
  • Text wrapping
  • Per-character coloring
  • Position → index and index → position mapping (cursor-ready)
  • Surgically accurate size measurement (WYSIWYG)

RectangleF.cs: Float-Based Rectangle

A MonoGame-compatible float rectangle that has grown a solid collection of utility methods over time. Used internally by both GuilBatch and GuilFont.


Font Generation Tool

Located at Tools/GuilFont File Generator.py is a GUI-based Python tool (powered by pygame) that takes any .ttf font and outputs a .guif file with pre-baked atlas textures across multiple sizes.


License

See LICENSE.txt.

About

A diverse 2D rendering toolkit for MonoGame, batched shapes, gradients, and sprites with a full-featured bitmap font engine that handles wrapping, text interaction, and multi-atlas automatic scaling.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages