UIWindow
From Mod Wiki
Class Tree
Overview
The most common window type can be used to draw text or materials within its rectangle.
In many places it is also used just for managing other windows, handling events and timelines.
This class may be used in the GUIs. It will inherit all properties, flags, functions and events from UIObject_Drawable.
Window type:
type window;
Example:
// Define properties required to display the warmup text at the center of the screen. windowDef warmupLabel { _big_text_props // Template: Sets the font size. properties { rect rect = 0, CENTER_Y - 28, SCREEN_WIDTH, 16; wstring text = player.matchStatus; // The text we're displaying float visible = gui.respawnLabel.visible == false && player.warmup && player.commandmapstate == 0 && player.commandmapstate == 0 && player.scoreboardActive == false && globals.gameHud.hideCrosshairCounter == 0; float flags = immediate( flags ) | WF_DROPSHADOW; } }
Properties
Flags
Functions
General Functions
attachRenderCallback Attach a render callback to the drawing of the window. attachInputHandler Attach an input handler for the window. drawMaterial Draw a material. drawRenderCallback Call the draw render callback for the given render callback handle. drawCachedMaterial Draw cached material. getCachedMaterialDimensions Get the width and height of the material. drawMaterialInfo Draw material. Get data from the material info. drawMaterialArc Draw an arc. drawTimer Draw a timer, used by the grenade indicator and progress indicators by the crosshair. drawText Draw text. measureText Measure the text. measureLocalizedText Measure the text. drawTiledMaterial Draw a tiled material. drawLocalizedText Text to be drawn. drawLine Draw a line. requestLayout Request the window layout to be calculated again. drawRect Draw a rectangle. nextTabStop Get the next tab stop for the specified window. prevTabStop Get the previous tab stop for the specified window. setTabStop Focuses the nth tab stop. containsPoint Checks if the (world-based) point is in the client rectangle. cacheRenderCallback Return a reference to a render callback. clipToRect Clip subsequent drawing to the clipping rectangle. Must be ended with unclipRect after clipped drawing is finished. unclipRect Remove clipping to rectangle specified in clipToRect. pushColor Push a color on the GUI's color stack. pushColorComponents Push a color on the GUI's color stack. popColor Pop a color from the GUI's color stack. drawShaderParm Set a shader parm value. isVisible Check if self is visible.
Events
onPreDraw Called before the window is about to draw. The event is often used for doing custom text and material drawing instead of the default drawing. onPostDraw Called after gamecode has finished drawing. onPostChildDraw Called after all descendants have finished drawing. onMouseMove Called when the mouse moves. onMouseEnter Called when the mouse enters the window. onMouseExit Called when the mouse exits the window. onKeyUp Called when a key is depressed. onKeyDown Called when a key is pressed. onKeyUpBind Called when keys using the bind is depressed. onKeyDownBind Called when keys usng the bind is pressed onShow When the visible property is changed to true. onHide When The hide property is changed to false. onGainFocus The window has gained focus. onLoseFocus The window has lost focus onDoubleClick Mouse is double clicked within the window's rectangle. onActivate This happens when the GUI is activated. onQueryToolTip Used to set a tooltip which will be shown when the mouse os hovering over the window. onNavForward Called when any key bound to the _menuNavForward is pressed onNavBackward Called when any key bound to the _menuNavBackward is pressed onAccept Called when any key bound to the _menuAccept is pressed onCancel Called when any key bound to the _menuCancel is pressed