Skip to content

windows

Thomas S edited this page Aug 22, 2020 · 3 revisions

Windows

Windows are a great features of uiz, and allow you to create user transformable, fully functional windows. A window is created using "uiz_window_create", and if you're a fancy person you can use "uiz_window_create_animation". During creation you predefine the size of the window (and animations).

After you've created the window, you can set which buttons (close, minimize, maximize) you'd like it to have. You can do this by using uiz_window_setbuttons(). The buttons can also be triggered manually using the following scripts, which need to be called inside a "with" construction using an instance id that you got from uiz_window_create(). It Should look like this (without the quote marks):

with(window){uiz_window_xxx()}:

You can use any of these scripts here:

  • uiz_window_unmaximize
  • uiz_window_unminimize
  • uiz_window_maximize_frommin
  • uiz_window_switchmaximize
  • uiz_window_switchminimize
  • uiz_window_minimize
  • uiz_window_minimize_frommax

Property Variables

  • windowtext["window"]: What text should be displayed in the window's title bar.
  • valign[fa_middle]: The vertical alignment of the windowtext.
  • halign[fa_left]: The horizontal alignment of the windowtext.
  • wholewidthalign[false]: Whether to make halign align to the entire topbar (wholewidthalign=true) or only to the non button piece (false).
  • windowtextcolor[c_black]: The color of the text displayed in the windowbar.
  • font[-1]: the font to use, a value of -1 means font will be ignored.
  • barsize[0.25]: How big the top bar should be.
  • barsizevaltype[dp]: The type of how big the bar should be.
  • button_cross[true]: If you want to have a cross button.
  • button_maximize[true]: If you want to have a maximize button.
  • button_minimize[true]: If you want to have a minimize button.
  • button_cross_color_normal[c_white]: The color of the close button when the mouse is not hovering over it.
  • button_cross_color_over[c_white]: The color of the close button when the mouse is hovering over it.
  • button_cross_color_in[c_white]: The color of the close button when the mouse is hovering clicking it.
  • button_cross_sprite[spr_uiZ_windowbutton_cross]: The sprite used for the window close button. This may consist of three subimages:
    • 0: normal (mouse not over) image.
    • 1: mouse over button image.
    • 2: mouse clicking button image.
  • button_maximize_color_normal[c_white]: The color of the maximize button when the mouse is not hovering over it.
  • button_maximize_color_over[c_white]: The color of the maximize button when the mouse is hovering over it.
  • button_maximize_color_in[c_white]: The color of the maximize button when the mouse is hovering clicking it.
  • button_maximize_sprite[spr_uiZ_windowbutton_maximize]: The sprite used for the window maximize button. This may consist of three subimages:
    • 0: normal (mouse not over) image.
    • 1: mouse over button image.
    • 2: mouse clicking button image.
  • button_minimize_color_normal[c_white]: The color of the minimize button when the mouse is not hovering over it.
  • button_minimize_color_over[c_white]: The color of the minimize button when the mouse is hovering over it.
  • button_minimize_color_in[c_white]: The color of the minimize button when the mouse is hovering clicking it.
  • button_minimize_sprite[spr_uiZ_windowbutton_minimize]: The sprite used for the window minimize button. This may consist of three subimages:
    • 0: normal (mouse not over) image.
    • 1: mouse over button image.
    • 2: mouse clicking button image.
  • maximizeanimation[uiz_elastic_inout]: The animation played when maximizing the window.
  • maximizeanimationspeed[0.3]: The time the animation played when maximizing the window takes.
  • unmaximizeanimation[uiz_elastic_inout]: The animation played when unmaximizing the window.
  • unmaximizeanimationspeed[0.2]: The time the animation played when unmaximizing the window takes.
  • minimizeanimation[uiz_wigle]: The animation played when minimizing the window.
  • minimizeanimationspeed[0.3]: The time the animation played when minimizing the window takes.
  • unminimizeanimation[uiz_wigle]: The animation played when unminimizing the window.
  • unminimizeanimationspeed[0.3]: The time the animation played when unminimizing the window takes.
  • destroyxfunction[uiz_straight]: The animation for the width when the window is being closed. This is actually a built in uiZ variable, not specific to the window object.
  • destroyyfunction[uiz_straight]: The animation for the height when the window is being closed. This is actually a built in uiZ variable, not specific to the window object.
  • destroyafunction[uiz_zero]: The animation for the alpha when the window is being closed. This is actually a built in uiZ variable, not specific to the window object.
  • destroyspeed[0.5]: The time in seconds the animation for closing the window takes. This is actually a built in uiZ variable, not specific to the window object.
  • contain[uiz_window_contain_corner]: What mode to use to keep the window inside of the screen. (so the window doesn't get lost) You can choose from:
    • uiz_window_contain_none: Don't try to contain the window. The use may be able to drag the window off screen.
    • uiz_window_contain_corner: Always keep a little movable corner of the window top bar in view. The corner size is determined by the height of the top bar and the existence of buttons (buttons are also kept in view since the user cannot move the window where there are buttons)
    • uiz_window_contain_topbar: Always keep the entire top bar in view. No parts of the top bar may appear outside of the window's parent (which is the UI root by default, the obj_uiZ_controller).
    • uiz_window_contain_window: Always keep the entire window in view. No parts of the window may appear outside of the window's parent (which is the UI root by default, the obj_uiZ_controller).
  • resizable[true]: Allow the user to resize the window by grabbing the edges.
  • keepratio[false]: Whether too maintain the window ratio when the user is resizing it. If a window was 100x200 px for examples, the user may resize it to 50x100 px, but not to 50x75 px.
  • minwidth[0]: What width the window has to be at the very least. UiZ may impose it's own minimum width policy to keep it functioning properly. (all buttons will always be in view and there will always be enough space for the window border)
  • minwidthtype[px]: What type of width the window has to be at the very least.
  • minheight[0]: What height the window has to be at the very least. UiZ may impose it's own minimum height policy to keep it functioning properly. (all buttons will always be in view and there will always be enough space for the window border)
  • minheighttype[px]: What type of height the window has to be at the very least.
  • doublemargins[false]: Add the margins from the normal background to the top_ background. May be needed for certain custom themes.
  • topbackuse[-1]: What type of backvalues to use for the top (0 for _normal, 1 for _over, 2 for _in and 3 for _out). Leave this at -1 for automatic selection.
  • topbarInside[false]: The window uses two backgrounds: one for the window itself, and a separate one for the top bar. If topbarInside is set to false, the top bar will overlap with the general window background. If topbarInside is set to true, the top bar will be placed within the general window background (so inside the inner margins of the background). What value this needs to be depends on the theme you want to use.

Readable variables/objects

  • sizestatus: What state the window is in:
    • 0: The window is minimized.
    • 1: The window is floating normally.
    • 2: The window is maximized
  • isresizing: Whether the window is being resized by the user.
  • global.selectedwindow: Global variable which holds the instance id of the window currently selected.

Functions

  • uiz_window_contain(instanceid, contain constant):
    • instanceid: the instance id of the instance you want to modify
    • contain constant[uiz_window_contain_corner]: What mode to use to keep the window inside of the screen. (so the window doesn't get lost) You can choose from:
      • uiz_window_contain_none: Don't try to contain the window. The use may be able to drag the window off screen.
      • uiz_window_contain_corner: Always keep a little movable corner of the window top bar in view. The corner size is determined by the height of the top bar and the existence of buttons (buttons are also kept in view since the user cannot move the window where there are buttons)
      • uiz_window_contain_topbar: Always keep the entire top bar in view. No parts of the top bar may appear outside of the window's parent (which is the UI root by default, the obj_uiZ_controller).
      • uiz_window_contain_window: Always keep the entire window in view. No parts of the window may appear outside of the window's parent (which is the UI root by default, the obj_uiZ_controller).
  • window id = uiz_window_create(width, valuetype, height, valuetype): Use this function to create a window of a given size, in the middle of the screen. The window pops up instantly after calling this function.
    • window id: The instance of the window created by this function. (This is a return value)
    • width: The desired width of the new window.
    • widthtype: The desired width type of the new window. Supports any value that posvalwtype can handle.
    • height: The desired height of the new window.
    • heighttype: The desired height type of the new window. Supports any value that posvalhtype can handle.
  • window id = uiz_window_create_animation(width, widthtype, height, heighttype, xfunction, yfunction, alphafunction, animationtime): Use this function to create a window of a given size, in the middle of the screen. The window is created using an animation. It it put in the center of the display and grows from there in width and height. It also fades in using alpha.
    • window id: The instance of the window created by this function. (This is a return value)
    • width: The desired width of the new window.
    • widthtype: The desired width type of the new window. Supports any value that posvalwtype can handle.
    • height: The desired height of the new window.
    • heighttype: The desired height type of the new window. Supports any value that posvalhtype can handle.
    • xfunction[uiz_smoothstep]: The animation to use for increasing the window's width when it opens.
    • yfunction[uiz_smoothstep]: The animation to use for increasing the window's height when it opens.
    • alphafunction[uiz_one]: The animation to use for increasing the window's opacity when it opens.
    • animationtime[0.75]: How long in seconds the window opening animation should take
  • uiz_window_keepratio(instanceid, keepratio[false]):
    • instanceid: the instance id of the instance you want to modify
    • keepratio[false]: Whether too maintain the window ratio when the user is resizing it. If a window was 100x200 px for examples, the user may resize it to 50x100 px, but not to 50x75 px.
  • uiz_window_maximize(): Function which has to be called inside of a with construction. Maximizes the window from a normal, floating state.
  • uiz_window_maximize_frommin(): Function which has to be called inside of a with construction. Maximizes the window from a minimized state.
  • uiz_window_switchmaximize(): Function which has to be called inside of a with construction. Maximizes the window if it is not maximizes. If the window was already maximizes, then it is unmaximizes.
  • uiz_window_unmaximize(): Function which has to be called inside of a with construction. Returns the window from a maximized state to a normal, floating state.
  • uiz_window_minimize(): Function which has to be called inside of a with construction. Minimizes the window from a normal, floating state.
  • uiz_window_minimize_frommax(): Function which has to be called inside of a with construction. Minimizes the window from a maximized state.
  • uiz_window_switchminimize(): Function which has to be called inside of a with construction. Minimizes the window if it is not minimized. If the window was already minimized, then it is unminimized.
  • uiz_window_unminimize(): Function which has to be called inside of a with construction. Returns the window from a minimized state to a normal, floating state.
  • uiz_window_select(instanceid): gives focus to the desired window, and unfocuses any currently focused window.
    • instanceid: the instance id of the instance you want to modify
  • uiz_window_setanimation(instanceid, maximizeanimation, maximizeanimationspeed, unmaximizeanimation, unmaximizeanimationspeed, minimizeanimation, minimizeanimationspeed, unminimizeanimation, unminimizeanimationspeed):
    • instanceid: the instance id of the instance you want to modify
    • maximizeanimation[uiz_elastic_inout]: The animation played when maximizing the window.
    • maximizeanimationspeed[0.3]: The time the animation played when maximizing the window takes.
    • unmaximizeanimation[uiz_elastic_inout]: The animation played when unmaximizing the window.
    • unmaximizeanimationspeed[0.2]: The time the animation played when unmaximizing the window takes.
    • minimizeanimation[uiz_wigle]: The animation played when minimizing the window.
    • minimizeanimationspeed[0.3]: The time the animation played when minimizing the window takes.
    • unminimizeanimation[uiz_wigle]: The animation played when unminimizing the window.
    • unminimizeanimationspeed[0.3]: The time the animation played when unminimizing the window takes.
  • uiz_destroyObject_setDestroyAnimation(instanceid,x Function, yFunction, alphaFunction, time): This is actually a built in uiZ function. However, it is listed here since a destroy animation is more relavant to the window than to other objects because the user is able to activate the destroy animation.
    • instanceid: the instance id of the instance you want to modify
    • Function: The animation for the width when the object is being destroyed.
    • yFunction: The animation for the height when the object is being destroyed.
    • alphaFunction: The animation for the alpha when the object is being destroyed.
    • time: The time in seconds the animation for destroying the object.
  • uiz_window_setbuttons(instanceid, button_cross, button_maximize, button_minimize):
    • instanceid: the instance id of the instance you want to modify
    • button_cross[true]: If you want to have a cross button.
    • button_maximize[true]: If you want to have a maximize button.
    • button_minimize[true]: If you want to have a minimize button.
  • uiz_window_setCloseButtonSettings(instanceid, sprite, normal color, mouse over color, mouse click color):
    • instanceid: the instance id of the instance you want to modify
    • sprite[spr_uiZ_windowbutton_cross]: The sprite used for the window close button. This may consist of three subimages:
      • 0: normal (mouse not over) image.
      • 1: mouse over button image.
      • 2: mouse clicking button image.
    • normal color[c_white]: The color of the close button when the mouse is not hovering over it.
    • mouse over color[c_white]: The color of the close button when the mouse is hovering over it.
    • mouse click color[c_white]: The color of the close button when the mouse is hovering clicking it.
  • uiz_window_setMaximizeButtonSettings(instanceid, sprite, normal color, mouse over color, mouse click color):
    • instanceid: the instance id of the instance you want to modify
    • sprite[spr_uiZ_windowbutton_maximize]: The sprite used for the window maximize button. This may consist of three subimages:
      • 0: normal (mouse not over) image.
      • 1: mouse over button image.
      • 2: mouse clicking button image.
    • normal color[c_white]: The color of the maximize button when the mouse is not hovering over it.
    • mouse over color[c_white]: The color of the maximize button when the mouse is hovering over it.
    • mouse click color[c_white]: The color of the maximize button when the mouse is hovering clicking it.
  • uiz_window_setMinimizeButtonSettings(instanceid, sprite, normal color, mouse over color, mouse click color):
    • instanceid: the instance id of the instance you want to modify
    • sprite[spr_uiZ_windowbutton_minimize]: The sprite used for the window minimize button. This may consist of three subimages:
      • 0: normal (mouse not over) image.
      • 1: mouse over button image.
      • 2: mouse clicking button image.
    • normal color[c_white]: The color of the minimize button when the mouse is not hovering over it.
    • mouse over color[c_white]: The color of the minimize button when the mouse is hovering over it.
    • mouse click color[c_white]: The color of the minimize button when the mouse is hovering clicking it.
  • uiz_window_setminimumsize(instanceid, width, widthtype, height, heighttype): What size the window has to be at the very least. UiZ may impose it's own minimum size policy to keep it functioning properly. (all buttons will always be in view and there will always be enough space for the window border)
    • instanceid: the instance id of the instance you want to modify
    • minwidth[0]: What width the window has to be at the very least.
    • minwidthtype[px]: What type of width the window has to be at the very least.
    • minheight[0]: What height the window has to be at the very least.
    • minheighttype[px]: What type of height the window has to be at the very least.
  • uiz_window_setResizable(instanceid, resizable[true]):
    • instanceid: the instance id of the instance you want to modify
    • resizable[true]: Allow the user to resize the window by grabbing the edges.
  • uiz_window_settextsettings(instanceid, halign, valign, wholewidthalign, windowtextcolor, font):
    • instanceid: the instance id of the instance you want to modify
    • halign[fa_left]: The horizontal alignment of the windowtext.
    • valign[fa_middle]: The vertical alignment of the windowtext.
    • wholewidthalign[false]: Whether to make halign align to the entire topbar (wholewidthalign=true) or only to the non button piece (false).
    • windowtextcolor[c_black]: The color of the text displayed in the windowbar.
    • font[-1]: the font to use, a value of -1 means font will be ignored.
  • uiz_window_settopbarBackgroundState(instanceid,topbackuse):
    • instanceid: the instance id of the instance you want to modify
    • topbackuse[-1]: What type of backvalues to use for the top (0 for _normal, 1 for _over, 2 for _in and 3 for _out). Leave this at -1 for automatic selection.
  • uiz_window_setTopBarDoubleMargins(instanceid, double margins):
    • instanceid: the instance id of the instance you want to modify
    • double margins[false]: Add the margins from the normal background to the top_ background. May be needed for certain custom themes.
  • uiz_window_setTopBarInside(instanceid, top bar inside general background):
    • instanceid: the instance id of the instance you want to modify
    • topbarInside[false]: The window uses two backgrounds: one for the window itself, and a separate one for the top bar. If topbarInside is set to false, the top bar will overlap with the general window background. If topbarInside is set to true, the top bar will be placed within the general window background (so inside the inner margins of the background). What value this needs to be depends on the theme you want to use.
  • uiz_window_setTopBarSize(instanceid, barsize, type):
    • instanceid: the instance id of the instance you want to modify
    • barsize[0.25]: How big the top bar should be.
    • type[dp]: The type of how big the bar should be.
  • uiz_window_setwindowtext(instanceid, text):
    • instanceid: the instance id of the instance you want to modify
    • text["window"]: What text should be displayed in the window's title bar.

Backgrounds

A window has 2 backgrounds: One background covering the entire window, and another smaller one covering the top bar of the window. The big background can be accessed through the normal background variables on the window object.
The background postfix values used will be:

  • _normal for a not selected window
  • _in for a selected window.

The postfix valuses are different for maximized windows:

  • _over for a not selected window
  • _out for a selected window.

The small top bar background can be accessed by adding a "top_" prefix and then use the normal variables on the window object. For example setting the texturescript of the topbar would be:

window.top_texturescript = uiz_back_square;

To find out how backgrounds work, and what the pre- and postfix values mean, see backgrounds

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