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
StringThe 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
StringUsed to link a window frame to a in game object such as a treasure chests inventory window
Notes: Required for Proper Memory Functions -
Name
StringUnique name for the window
Notes: Required for Proper Memory Functions -
Title
StringText displayed in the header
Notes: when ShowHeader=True -
StartPosition
enum: WindowFramePositionInitial opening position of window, if movement is allowed and memory enabled then the memory location will override this after initial open.
-
LockedToStartPosition
BoolLock the window to the start position. When enabled screen resizing will also be respected and window placement adjusted accordingly.
-
WindowMemoryEnabled
BoolEnables location and size memory for the window
-
AllowMultipleInstances
BoolAllows 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
BoolToggle 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
BoolCan the window be set full screen, enables default menu options for fuillscreen/restore
-
LockedFullscreen
BoolForces the window to fill the screen, useful for startup or escape key menus
-
MinWidth
IntegerOptionally specify a minimum width for the window
Notes: Can also be set in the style setting of the theme -
MinHeight
IntegerOptionally specify a minimum height for the window
Notes: Can also be set in the style setting of the theme -
DefaultWidth
IntegerDefault starting width for the window
Notes: Can also be set in the style setting of the theme -
DefaultHeight
IntegerDefault starting height of the window
Notes: Can also be set in the style setting of the theme -
ShowHeader
BoolOptionally show the header
Notes: Required true to allow moving the window -
AllowResize
BoolCan the window be resized
Notes: Requires footer to be visible -
AllowClose
BoolCan the window be closed
-
AllowMove
BoolCan the window me moved on screen
Notes: Requires header to be visible -
AllowLock
BoolCan the player lock/unlock the window placement and size
-
Locked
BoolIs the window currently locked
Notes: Disable many features such as movement and resizing -
OptionsMenuTooltip
StringOptional tooltip assignemnt for the options menu
Notes: Default: Open Option Menu -
ResizeAreaTooltip
StringOptional tooltip assignemnt for the resize area
Notes: Default: Click to Resize Window -
ContextMenuConfig
object: ContextMenuConfigOptional custom configuration for the context menu of this window.
-
Content
VisualElementContainer 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.
Code snipet for creating a new window with all options
Example Dynamic 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.