Libove Blog

Personal Blog about anything - mostly programming, cooking and random thoughts

#gamedev progress:

  • built a UI system using "immediate mode" style.

Code for one button:

if (d.add_inter(.{ .BUTTON = .{} }, .{ .owner = i, .item = 0, .index = 0 })) {
    std.debug.print("BUTTON KITCHEN\n", .{});
}
d.down();
{
    d.add(.{ .V_LIST = .{} });
    d.down();
    {
        d.add(.{ .TEXT = .{ .text = "Kitchen", .box = rl.Vector2.init(200, 20) } });
        d.add(.{ .TEXT = .{ .text = "100 G", .box = rl.Vector2.init(200, 20) } });
    }
    d.up();
}
d.up();

gif showing UI dialogs popping up and highlighting buttons under the mouse

#zig