Creates a checkbox that starts checked or not; checkSizeRatio is how much of the square the
inner mark fills.
The name, the checked state, the mark size, the colors and the optional size
The checkbox
const checkbox = bitbybit.babylon.gui.checkbox.createCheckbox({ name: "showEdges", isChecked: true, checkSizeRatio: 0.8, color: "#f0cebb", background: "black", width: "30px", height: "30px" });
panel.addControl(checkbox);
checkbox.onIsCheckedChangedObservable.add((checked) => { console.log(checked); });
Passes through the name of a checkbox event, its checked state changing, as a typed selector for code that subscribes to checkbox events by name.
The event selector
The same selector
Reads how much of a checkbox's square its inner mark fills.
The checkbox
The ratio
Reads whether a checkbox is currently checked, true for on.
The checkbox
True when checked
Reads the background color of a checkbox's square.
The checkbox
The background color
Sets the background color of a checkbox's square, as a CSS color.
The checkbox and the background color
The same checkbox
Sets how much of a checkbox's square its inner mark fills, from 0 to 1.
The checkbox and the ratio
The same checkbox
Checks or unchecks a checkbox, which fires its checked changed event like a click would.
The checkbox and the flag
The same checkbox
Checkboxes: square toggles that are on or off, for yes or no choices. Subscribe to the checked changed event to react to the user.