index

gets/sets the index of the selected option in the options array. Must be a positive, whole number inside the bounds of the options array

Examples



const dropdown = $.makeDropdown($.w/2, $.w/2, 100, [
    "Option A",
    "Option B",
    "Option C",
    "Option X",
    "Option Y",
    "Option Z",
    "Option Q",
    "Option R",
    "Option S"
]);


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