value

gets the corresponding option in the options array based on the index property. Readonly.

Examples



const dropdown = $.makeDropdown($.w/2, $.h/2, 100, [
    "Option A",
    "Option B",
    "Option C"
]);

function update() {
    dropdown.draw();
    $.text.print(dropdown.x, dropdown.y-25, "Value:"+dropdown.value);
}