Bitbybit Docs
    Preparing search index...

    Class BabylonGuiCheckbox

    Checkboxes: square toggles that are on or off, for yes or no choices. Subscribe to the checked changed event to react to the user.

    Index

    Constructors

    create

    • Creates a checkbox that starts checked or not; checkSizeRatio is how much of the square the inner mark fills.

      Parameters

      • inputs: CreateCheckboxDto

        The name, the checked state, the mark size, the colors and the optional size

      Returns Checkbox

      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); });

    get

    • Reads how much of a checkbox's square its inner mark fills.

      Parameters

      Returns number

      The ratio

    • Reads whether a checkbox is currently checked, true for on.

      Parameters

      Returns boolean

      True when checked

    • Reads the background color of a checkbox's square.

      Parameters

      Returns string

      The background color

    set

    • Sets the background color of a checkbox's square, as a CSS color.

      Parameters

      Returns Checkbox

      The same checkbox

    • Checks or unchecks a checkbox, which fires its checked changed event like a click would.

      Parameters

      Returns Checkbox

      The same checkbox