GUIWindow

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function creates a GUI window.

Syntax

  1. GUIWindow GUIWindow( VectorScreen pos, ScreenSize size, string titletext )

Arguments

  • pos - The position of the window on screen
  • size - The size of the window as a ScreenSize object
  • titletext - The window title text

Example

This example creates a window in the center of the client's screen, once they spawn.

  1.  
  2. function onClientSpawn(spawnclass)
  3. {
  4. // We use VectorScreen to set the GUI position. When aligning to the center, we minus half the width/height.
  5. local pos = VectorScreen(ScreenWidth/2-245,ScreenHeight/2-50);
  6. // We use ScreenSize to set the GUI size.
  7. local size = ScreenSize(490,100);
  8. // Create the window with the title "Example Window", and declare it TheWindow
  9. TheWindow <- GUIWindow(pos,size,"Example Window");
  10. // Create a layer for our new window
  11. AddGUILayer(TheWindow);
  12. }
  13.  

Notes

The function AddGUILayer was used in this example. More info about this can be found in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox