Skip to content

functionbar

Thomas edited this page Apr 10, 2020 · 3 revisions

obj_uiZ_functionbar

A horizontal function bar as seen in the uiz designer. It it also somewhat reminiscent of office programs. This object may require some extra scripts to be setup properly.

Property variables

  • marginy[10]: how many pixels there should be between the items and the edge of the bar in the y direction.
  • marginx[10]: how many pixels there should be between the items and the edge of the bar in the x direction.
  • ratio[0.75]: a ratio of how wide the items should be compared to the height.
  • currenttab[0]: What tab you are on. If not sure how tabs work, leave at 0.
  • backcolor[c_white]: The color of the background, behind the items.
  • backalpha[1]: Alpha value for the background which will be multiplied by the general alpha value. (see built in object-variables)
  • **graphtype:[uiz_smoothstep]:**What animation the scrolling should have when you scroll the bar(only aviable when there are more items on the bar that fit on the screen.).
  • countspeed[0.1]: How long the animation should take in seconds.
  • coloringfactor[0.3]: How much colors should change when you mouse over an item.

Readable variables

  • onitem: What item the mouse is over. -1 for no item. Even works when no items are present.

Functions

  • itemid = uiz_functionbar_additem(functionbarid,text,sprite,clickedscript,menuscript,color): Adds a new button to the functionbar. The new button will be the most right button.
    • itemid: Returns the index of the item, which can later be using in a function like uiz_functionbar_setitem.
    • functionbarid: The instance id of a function bar object.
    • text: The text on the top of the item.
    • sprite: the sprite that the function bar should have. The sprite doesn't have to be a specific size, but something square will give the best results.
    • clickedscript: this should be a script you created, whenever you click on the item, this script will be executed. Set to 0 for no script.
    • menuscript: this should be a script you created, whenever you click on the little arrow below the item, this script will be executed. Set to 0 for no script.
    • color: this will set the tone/color of the item buttons. The color to what the item changes when the mouse goes over it is automatically generated.
  • uiz_functionbar_setitem(functionbarid,itemid,text,sprite,clickedscript,menuscript,color)
    • itemid: The index of the item. The most left item will have an index of 0, while the 3rd item from the left will have an index of 2.
    • functionbarid: The instance id of a function bar object.
    • text: The text on the top of the item.
    • sprite: the sprite that the function bar should have. The sprite doesn't have to be a specific size, but something square will give the best results.
    • clickedscript: this should be a script you created, whenever you click on the item, this script will be executed. Set to 0 for no script.
    • menuscript: this should be a script you created, whenever you click on the little arrow below the item, this script will be executed. Set to 0 for no script.
    • color: this will set the tone/color of the item buttons. The color to what the item changes when the mouse goes over it is automatically generated.
  • uiz_functionbar_setcolor_fortext(barid,name,color): Searches for an item in a obj_uiZ_functionbar object using the text associated with that item. Once it found an item it sets the color value to the new specified one.
    • barid: The instance id of a function bar object.
    • name: The text on the top of the function button of which you want to change the color
    • color: The color the button should become.
  • uiz_functionbar_setmenu_fortext(barid,name,script): Searches for an item in a obj_uiZ_functionbar object using the text associated with that item. Once it found an item it sets the menu script value to the new specified one.
    • barid: The instance id of a function bar object.
    • name: The text on the top of the function button of which you want to change the color
    • menuscript: this should be a script you created, whenever you click on the little arrow below the item, this script will be executed. Set to 0 for no script.
  • uiz_functionbar_setclicked_fortext(barid,name,script): Searches for an item in a obj_uiZ_functionbar object using the text associated with that item. Once it found an item it sets the clicked script value to the new specified one.
    • barid: The instance id of a function bar object.
    • name: The text on the top of the function button of which you want to change the color
    • clickedscript: this should be a script you created, whenever you click on the item, this script will be executed. Set to 0 for no script.
  • uiz_functionbar_setsprite_fortext(barid,name,sprite): Searches for an item in a obj_uiZ_functionbar object using the text associated with that item. Once it found an item it sets the sprite to the new specified one.
    • barid: The instance id of a function bar object.
    • name: The text on the top of the function button of which you want to change the color
    • sprite: the sprite that the function bar should have. The sprite doesn't have to be a specific size, but something square will give the best results.
  • uiz_functionbar_settext_fortext(barid,name,string text): Searches for an item in a obj_uiZ_functionbar object using the text associated with that item. Once it found an item it sets the color value to the new specified one. WATCH OUT with this function as it can overwrite the text and thus make the item unfindable again.
    • barid: The instance id of a function bar object.
    • name: The text on the top of the function button of which you want to change the color
    • text: The text on the top of the item.
  • uiz_functionbar_setmargins(instanceid,x,y):
    • instanceid: the instance id of the instance you want to modify
    • marginy[10]: how many pixels there should be between the items and the edge of the bar in the y direction.
    • marginx[10]: how many pixels there should be between the items and the edge of the bar in the x direction.
  • uiz_functionbar_setratio(instanceid,ratio):
    • instanceid: the instance id of the instance you want to modify
    • ratio[0.75]: a ratio of how wide the items should be compared to the height.
  • uiz_functionbar_settings(instanceid,backcolor,backalpha):
    • instanceid: the instance id of the instance you want to modify
    • backcolor[c_white]: The color of the background, behind the items.
    • backalpha[1]: Alpha value for the background which will be multiplied by the general alpha value. (see built in object-variables)
  • uiz_functionbar_setanimation(instanceid,graphtype,countspeed,coloringfactor):
    • instanceid: the instance id of the instance you want to modify
    • **graphtype:[uiz_smoothstep]:**What animation the scrolling should have when you scroll the bar(only aviable when there are more items on the bar that fit on the screen.).
    • countspeed[0.1]: How long the animation should take in seconds.
    • coloringfactor[0.3]: How much colors should change when you mouse over an item.

Visuals

uiz_functionbar_additem(o,"test gear",spr_uiZ_gear,0,0,make_colour_rgb(245,203,188))//light salmon
uiz_functionbar_additem(o,"test save icon",spr_uiZ_save,0,0,make_colour_rgb(183,187,247))//pale cornflower blue
uiz_functionbar_additem(o,"test folder",spr_uiZ_folder,0,0,make_colour_rgb(255,253,145))//canary yellow

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