This function creates a checkbox control within the current debug section.
The checkbox takes the value of a Boolean variable. Clicking it toggles the variable.
The current debug section is the one last created using dbg_section.
NOTE This debug control spans two columns.
dbg_checkbox(ref[, label]);
Argument | Type | Description |
---|---|---|
ref | Reference | A reference to a Boolean variable created using ref_create |
label | String | OPTIONAL A label to display next to the checkbox |
N/A
Create Event
toggle = false;
var _ref_to_toggle = ref_create(self, "toggle");
dbg_checkbox(_ref_to_toggle, "The Toggle Switch");
The code above sets a boolean variable toggle in the Create event. It creates a reference to the variable using ref_create, stores it in a local variable _ref_to_toggle and passes that to dbg_checkbox. Since no calls were made to dbg_view or dbg_section, a new view "Default" and a new section "Default" are created that the checkbox control is added to. The checkbox will show a text label "The Toggle Switch" next to it.