{{docsMenuData.data.title}}

Window Framework for Unity UI Toolkit

Window Options

Window Frames have various attribute settings that aid in the creation of the perfect window to suit the situation.
Since the Window Framework uses UI Toolkit Visual Elements all standard properties are available to the Window Frame, some have been added to the Window Frame class as UXML Attributes to make them easier to access and add additional needed functionality during use.
Elements such as the assigned USS style sheet for example use the Window Controllers Theme manager to assign the active theme USS style sheet to the window frame at runtime.

  • WindowID
    String

    The Window Id is used for window memory features. Combine with the ParentObjectId to generate unique instances of custom types.

    Notes: A Unique Window ID is required for Memory Features to work
  • ParentObjectID
    String

    Used to link a window frame to a in game object such as a treasure chests inventory window

    Notes: Required for Proper Memory Functions
  • Name
    String

    Unique name for the window

    Notes: Required for Proper Memory Functions
  • Title
    String

    Text displayed in the header

    Notes: when ShowHeader=True
  • StartPosition
    enum: WindowFramePosition

    Initial opening position of window, if movement is allowed and memory enabled then the memory location will override this after initial open.

  • LockedToStartPosition
    Bool

    Lock the window to the start position. When enabled screen resizing will also be respected and window placement adjusted accordingly.

  • WindowMemoryEnabled
    Bool

    Enables location and size memory for the window

  • AllowMultipleInstances
    Bool

    Allows or Dissallows multpiple version of the window to be opened. Very useful for windows that must be unique such as settings, or character screens.

    Notes: Default = true
  • Fullscreen
    Bool

    Toggle the window to bo fullscreen or not, restores window to location and size when toggled to false.

    Notes: Locks window while Fullscreen and removes any radius in window border styling
  • AllowFullscreen
    Bool

    Can the window be set full screen, enables default menu options for fuillscreen/restore

  • LockedFullscreen
    Bool

    Forces the window to fill the screen, useful for startup or escape key menus

  • MinWidth
    Integer

    Optionally specify a minimum width for the window

    Notes: Can also be set in the style setting of the theme
  • MinHeight
    Integer

    Optionally specify a minimum height for the window

    Notes: Can also be set in the style setting of the theme
  • DefaultWidth
    Integer

    Default starting width for the window

    Notes: Can also be set in the style setting of the theme
  • DefaultHeight
    Integer

    Default starting height of the window

    Notes: Can also be set in the style setting of the theme
  • ShowHeader
    Bool

    Optionally show the header

    Notes: Required true to allow moving the window
  • ShowFooter
    Bool

    Optionally show the footer

    Notes: Required true to allow resizing the window
  • AllowResize
    Bool

    Can the window be resized

    Notes: Requires footer to be visible
  • AllowClose
    Bool

    Can the window be closed

  • AllowMove
    Bool

    Can the window me moved on screen

    Notes: Requires header to be visible
  • AllowLock
    Bool

    Can the player lock/unlock the window placement and size

  • Locked
    Bool

    Is the window currently locked

    Notes: Disable many features such as movement and resizing
  • OptionsMenuTooltip
    String

    Optional tooltip assignemnt for the options menu

    Notes: Default: Open Option Menu
  • ResizeAreaTooltip
    String

    Optional tooltip assignemnt for the resize area

    Notes: Default: Click to Resize Window
  • ContextMenuConfig
    object: ContextMenuConfig

    Optional custom configuration for the context menu of this window.

  • Content
    VisualElement

    Container for your custom content. Since this is a framework and not a managed UI, you will need to create functional content to display within the window frames content section, just like a frame from the store, you must supply the picture to show.

    Notes: This is also where UI builder will place items when added from the visual interface.
  • FooterToolbar
    VisualElement

    Additional content area that can hold more custom content. Banking toolbar, stats system, etc... whatever additional information you want to display.

    Notes: Content for this section can only be added via code at this time
    (Next version will support UI Builder drag and drop for footer toolbar elements)
Code snipet for creating a new window with all options
code example for unity ui toolkit uxml attributes
Example Dynamic Window with No Content
example runtime window with no content

Window above was created with code and no content.
This shows what the Window Framework actually gives you, a typical 'Window' that is movable and resizable, just needs content.

Window Memory

The default is to have window memory off, so any window created will need to have its Window Memory setting set to true in order to save its location, size and open status. You MUST use the same name and parent ID when opening the window so that its data can be looked up in window memory.

The Window Frame Controller has a method to clear all window frame settings that is accessible at runtime from the settings window
(buttons on the demo window and the example escape menu window).

Note: The Window Memory is stored in the persistent data directory of the application and will not be cleared when the application is closed. This means that if you want to clear the memory you will need to do so manually or use the provided method in the Window Frame Controller.

To reopen all memory enabled windows that were open when playmode stopped, you make a single call to the WindowFrameController at the proper time in your start sequence.
WindowFrameController.Instance.ReopenWindows();

You can also pass in an optional float delay time to the ReopenWindows method.
WindowFrameController.Instance.ReopenWindows(float);
This will wait for the specified delay time before reopening the windows, allowing for any other initialization to complete first.
Defailt is 0.1 seconds if no value is passed in.