Skip to content
Ty edited this page Mar 22, 2024 · 1 revision

Macros are intended to be simple and easy.
In the future, I hope to add arguments to macros. As of now, you can only offset the macro by the X and Y coordinates.

Creating a Macro

macro my_rect {
   prim rect;
   xyz2 100,100;
   xyz2 200,200;
}

Using a Macro

draw_rectangles {
    rgba 255,0,0;
    macro my_rect;
}

Once emitted, the above is equivalent to

draw_rectangles {
   rgba 255,0,0;
   prim rect;
   xyz2 100,100;
   xyz2 200,200;
}

Offsetting a Macro

draw_rectangles {
    rgba 255,0,0;
    macro my_rect 50,50;
}

Which is equivalent to

draw_rectangles {
   rgba 255,0,0;
   prim rect;
   xyz2 150,150;
   xyz2 250,250;
}
Clone this wiki locally