Bitbybit Docs
    Preparing search index...

    Class BabylonGuiRadioButton

    Radio buttons: round toggles of which only one per group can be checked at a time, for picking one option from a few. Subscribe to the checked changed event to react to the user.

    Index

    Constructors

    create

    • Creates a radio button in a group; checking one radio button unchecks the others of the same group. checkSizeRatio is how much of the circle the inner dot fills.

      Parameters

      • inputs: CreateRadioButtonDto

        The name, the group, the checked state, the dot size, the colors and the optional size

      Returns RadioButton

      The radio button

      const optionA = bitbybit.babylon.gui.radioButton.createRadioButton({ name: "optionA", group: "material", isChecked: true, checkSizeRatio: 0.8, color: "#f0cebb", background: "black", width: "30px", height: "30px" });
      panel.addControl(optionA);
      optionA.onIsCheckedChangedObservable.add((checked) => { console.log(checked); });

    get

    • Reads how much of a radio button's circle its inner dot fills.

      Parameters

      Returns number

      The ratio

    • Reads the group a radio button belongs to.

      Parameters

      Returns string

      The group name

    • Reads the background color of a radio button's circle.

      Parameters

      Returns string

      The background color

    set

    • Moves a radio button to a group; only one radio button of a group can be checked at a time.

      Parameters

      Returns RadioButton

      The same radio button

    • Sets the background color of a radio button's circle, as a CSS color.

      Parameters

      Returns RadioButton

      The same radio button