Skip to content

template

Thomas edited this page Sep 19, 2020 · 5 revisions

obj_uiZ_template

The most basic object in uiz which doesn't do anything. It has the minimum amount of code to call it an "uiz object". You can place your drawing code inside the premade script in the Draw "User Defined 0" event right after the line "//put draw code here".

Your own uiZ object can contain the following User Defined events:

  • User Defined 0: Put your draw code here. You may draw whatever you need from the coordinates rx,ry to rlx,rly (but not on rlx or rly itself). The ix,iy and ilx,ily refer to the inner coordinates of the object. Anything you draw here will be contained within a certain area.
  • User Defined 1: Defines mouse behavior. By default this should contain uiz_mouse_docheck(). This event may change if you decide to use scrollbars for example. If this event is omitted, the object cannot interact with the mouse.
  • User Defined 2: An event that is activate whenever the mouse state of the object changes. So for example when the mouse wasn't on the object before, but is now. Or when the mouse starts clicking the object. This event fires once per state change. The variable "kmouseover" can be read and compared to the constants uiz_nomouse, uiz_mouseover, uiz_mouseclick, uiz_mousepressed and uiz_mousereleased to determine what the mouse is doing.
  • User Defined 3: An event which is continuously fired as long as the mouse is hovering over the object.
  • User Defined 4: Works like a step event, but can be enabled or disabled on demand by using the uiz_updater_step() and uiz_updater_unstep() functions. Useful if an object does a temporary animation.
  • User Defined 5: Used to run code once in the end step event. Use the function uiz_updater_step_endcheck() to run this event once.
  • User Defined 6: Used to run code once in the begin step event. Use the function uiz_updater_step_beginCheck() to run this event once.
  • User Defined 7: Used for scrollbar specific code. If your object uses a scrollbar, then this event is activated when the mouse hovers over your scrollable object. This differs from User Defined 3 in that objects that don't have a scrollbar are ignored. This means that if this object has scrollbars and User Defined 3 is firing, then User Defined 7 is also firing. If User Defined 7 is firing, this doesn't necessarily mean that User Defined 3 is also firing on this object. See obj_uiZ_template_scrollbar for an example.
  • User Defined 8: Activated whenever the position or settings of the object change. (called during a "fix")

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