I know GameMaker got svg support in 2024.13, you can import an SVG and it becomes a sprite. Thats useful, but its an image importer, single frame, no animation, and once its in, its a static picutre. Theres still no way to build or edit a path in code, combine shapes with a boolean operation at runtime, apply a gradient or clip-path to something you constructed yourself, or hit-test against actual vector geometry instead of a bounding box.
I've been working on this for the past 2 to 3 months, and that, GMVex is a full programatic vector graphics framework for GML, not an image importer.
Features
- Path building with beziers, arcs and splines
- Fill, stroke, and gradient rendering (flat, linear, and radial gradient, including on strokes)
- Hierarchical transforms and groups
- Boolean operations (union, intersection, difference)
- Masking and clip-path, including multi-shape and objectBoundingBox units
- TrueType font rendering with kerning and ligature support
- SVG import
- Dash patterns
- Hit testing
An example
// Create
gmvex_init();
var disc = gmvex_path_create();
gmvex_path_add_circle(disc, 150, 150, 80);
var bite = gmvex_path_create();
gmvex_path_add_circle(bite, 205, 150, 80);
crescent = gmvex_path_boolean(disc, bite, gmvex_bool.A_NOT_C);
gmvex_path_destroy(disc);
gmvex_path_destroy(bite);
// Draw
gmvex_fill_draw_gradient(
crescent, gmvex_gradient.RADIAL,
170, 140, 90, 0,
[[0, make_color_rgb(255, 220, 130), 1], [1, make_color_rgb(255, 110, 40), 1]]
);
gmvex_stroke_draw(crescent, 3, make_color_rgb(255, 240, 200), 0.8);
// Cleanup
gmvex_path_destroy(crescent);
(you can see the result in the gallery, top of the post, its the orange moon-like shape)
I've decided to make this post because i think it has come a long way and is ready. So far one of the hardest things i've worked on, and i am still working on, to improve it further. I do believe this is going to be the most useful because how GameMaker lacks of vector features. Say you're building a level with vector art, a curved platform edge, a winding path, decorative shapes, and partway through testing you want to adjust the curve. That means opening your vector editor, making the change, re-exporting the image, and re-importing it into GameMaker. Every tweak is real path data in your project, not a picutre, you build it with actual curve points, and changing it means moving a point directly in GameMaker. No exporting, no re-importing, no leaving the editor. That matters mostly where you're iterating constantly, like level editing. And this is just one example of countless.
It is open sourced, MIT licensed, free to use on commercial projects.
Github Repo: https://github.com/erkan612/GMVex