Skip to content

obj_uiZ_radiobox

Thomas edited this page Jun 7, 2020 · 2 revisions

obj_uiZ_Radiobox

A simple radiobutton used to select an item from a form where only one item may be selected. In most operating systems and browsers, these are the circular buttons visible on many pages.
You can use the variable "group" to a specific value, to make sure that all objects which also have that specific value for "group" will all be deselected.
Once the radiobutton has been selected, it can't be deselected anymore until another radiobutton from the same group has been clicked.

For the radiobox, there are two ways to show that a radiobox is selected:

  • Using a selection circle: This is a circle drawn in the middle using draw_circle(). It is a solid color with an optional outline. This mode is used when no sprite has been set.
  • Using a sprite: By specifying the "sprite" property a sprite is drawn in the middle of the radiobox when it is selected. If "sprite" is set to -1, the radiobox will fall back to using a solid circle.
  • Using nothing: When "sprite" is set to -2, not even a selection circle is drawn. There will not be a way for the user to tell that this radiobox is selected.

Settings

  • checkcolor[c_black]: The color the selection circle will have. (The circle appearing when the radiobox is selected)
  • checkoncolor[c_dkgray]: The color the selection circle will have when the mouse is over the checkbox while it is checked.
  • checkincolor[c_black]: The color the selection circle will have when the mouse clicks the checkbox while it is checked.
  • outline[false]: Whether the selection circle should have an outline.
  • outlinecolor[c_black]: The color of the selection circle outline.
  • outlineoncolor[c_black]: The color of the selection circle outline when the mouse hovers over the object.
  • outlineoncolor[c_black]: The color of the selection circle outline when the mouse clicks the object.
  • circlesize[0.9]: The diameter of the selection circle.
  • circlesizetype[fc]: The type of diameter for circlesize.
  • margin[1]: An extra pixel margin to add between the selection circle and the inner space of the checkbox.l
  • group[""]: A variable which can be a string or a real number. This groups multiple radioboxes together. Only one radiobox inside a group can be selected at a time. That means when a radiobox 1 in group A is selected and radiobox 2 in group A is clicked, radiobox 1 will be unselected and radiobox 2 will be selected.
  • sprite[-1]: The sprite index of the checkmark that should be drawn. If this is equal to -1 then a primitive selection circle will be drawn. If this is -2 only the background will be drawn.
  • spriteimg[0]: The image index of the sprite.
  • spritecolor[c_white]: The color blend of the sprite by default.
  • spriteoncolor[c_white]: The color blend of the sprite when the mouse hovers over it.
  • spriteincolor[c_white]: The color blend of the sprite when the mouse is pressing it.

This object has a background, and all its associated variables about which you can learn more here

Functions

  • uiz_radiobox_setcheckcolor(instanceid,normal[c_black],mouse over[c_dkgray],mouse click[c_black]):
    • instanceid: the instance id of the instance you want to modify
    • normal: The color the selection circle will have. (The circle appearing when the radiobox is selected)
    • mouse over: The color the selection circle will have when the mouse is over the checkbox while it is checked.
    • mouse click: The color the selection circle will have when the mouse clicks the checkbox while it is checked.
  • uiz_radiobox_setoutline(instanceid,enabled[false]):
    • instanceid: the instance id of the instance you want to modify
    • enabled: Whether the selection circle should have an outline.
  • uiz_radiobox_setoutlinecolor(instanceid,normal[c_black],mouse over[c_black],mouse click[c_black]):
    • instanceid: the instance id of the instance you want to modify
    • normal: The color of the selection circle outline.
    • mouse over: The color of the selection circle outline when the mouse hovers over the object.
    • mouse click: The color of the selection circle outline when the mouse clicks the object.
  • uiz_radiobox_setcirclesize(instanceid,size[0.9],type[fc]):
    • instanceid: the instance id of the instance you want to modify
    • size: The diameter of the selection circle.
    • type: The type of diameter for circlesize.
  • uiz_radiobox_setgroup(instanceid,group[""] real or string):
    • instanceid: the instance id of the instance you want to modify
    • group: A variable which can be a string or a real number. This groups multiple radioboxes together. Only one radiobox inside a group can be selected at a time. That means when a radiobox 1 in group A is selected and radiobox 2 in group A is clicked, radiobox 1 will be unselected and radiobox 2 will be selected.
  • uiz_radiobox_setsprite(instanceid,sprite[-1],image[0],color[c_white],mouse over color[c_white],mouse click color[c_white]):
    • instanceid: the instance id of the instance you want to modify
    • sprite: The sprite index of the checkmark that should be drawn. If this is equal to -1 then a primitive selection circle will be drawn. If this is -2 only the background will be drawn.
    • image: The image index of the sprite.
    • color: The color blend of the sprite by default.
    • mouse over color: The color blend of the sprite when the mouse hovers over it.
    • mouse click color: The color blend of the sprite when the mouse is pressing it.
  • uiz_radiobox_setvalue(instanceid,value[false]): Function to select this radiobox. Any other radiobox selected in the same group will be unselected.
    • instanceid: the instance id of the instance you want to modify
    • value: Whether the radiobox is selected.
  • value = uiz_radiobox_getvalue(instanceid): get if this radiobox is selected.
    • value: Whether the radiobox is selected.
    • instanceid: the instance id of the instance you want to modify

Readable variables

  • update: Whether the radiobox has just been clicked.
  • updated: Whether the radiobox has just been clicked.
  • value: Whether this radiobox is selected.

Visuals

Wiki pages

🏑Home / General
πŸ“ƒTutorials
πŸ‘ͺ Parent
↕️ Positioning
πŸ›  Fixing & Updating
πŸ• Depth
πŸ“ƒ Templates and Examples
πŸŒ† Background
πŸ“‡ Structures
🎈 Objects

obj_uiZ_3waybutton
obj_uiZ_button
obj_uiZ_checkbox
obj_uiZ_clock
obj_uiZ_colorbox
obj_uiZ_cover
obj_uiZ_drawdslist obj_uiZ_dropdown
obj_uiZ_easybutton
obj_uiZ_frame
obj_uiZ_framescrollbar
obj_uiZ_functionbar
obj_uiZ_gradientsquare
obj_uiZ_gradientroundrect
obj_uiZ_gridlist
obj_uiZ_huesquare
obj_uiZ_loadingbar
obj_uiZ_loadingcircle
obj_uiZ_menubutton
obj_uiZ_mousemenu
obj_uiZ_radiobox
obj_uiZ_rotator
obj_uiZ_slider
obj_uiZ_scrollbar
obj_uiZ_slider_2col
obj_uiZ_slickslider
obj_uiZ_slideframe
obj_uiZ_sprbutton
obj_uiZ_spriteanimationbutton
obj_uiZ_spritecounter
obj_uiZ_stringbox
obj_uiZ_sliderstruct
obj_uiZ_surfacecanvas
obj_uiZ_sprite
obj_uiZ_square
obj_uiZ_squarebutton
obj_uiZ_swipicon
obj_uiZ_switch
obj_uiZ_tabslider
obj_uiZ_tabs
obj_uiZ_treelist
obj_uiZ_text
obj_uiZ_text_background
obj_uiZ_textarea
obj_uiZ_valuebox


🎈 Your own objects
🚫 Destroy
🐭 Mouse
πŸ’» Windows (uiz)
🌌 Animations
❓ General
πŸ“’ Numbers
πŸ“’ Strings
✏️ Draw
🚩 Popup
πŸ“‚ Files
πŸ’» Windows (os)

Clone this wiki locally