checked

gets/sets the current checked status of the checkbox. Default false.

Examples



const checkbox = $.makeCheckbox($.w/2, $.h/2, 32);

function update() {
    checkbox.draw();

    if (checkbox.checked) {
        $.text.print(
            checkbox.x, 
            checkbox.y - 50,
            "Checked!"
        );
    } else {
        $.text.print(
            checkbox.x,
            checkbox.y - 50,
            "Unchecked"
        );
    }
}