Returns the origin frame of the given type. Do not first-call frame handle getters inside GetLocalPlayer(); acquire/cache handles for all players first. For custom UI setup, prefer elapsed game time 0.00 or later.
public function getOriginFrame(originframetype frameType) returns framehandle
public function getOriginFrame(originframetype frameType, integer index) returns framehandle
Returns the origin frame of the given type and index. Do not first-call frame handle getters inside GetLocalPlayer(); acquire/cache handles for all players first. For custom UI setup, prefer elapsed game time 0.00 or later.
public function getFrame(string name, integer createContext) returns framehandle
Returns the framehandle of the given name and createContext index (children inherit the createContext value of their parent). Do not first-call frame handle getters inside GetLocalPlayer(); acquire/cache handles for all players first. For custom UI setup, prefer elapsed game time 0.00 or later.
public function getFrame(string name) returns framehandle
Returns the framehandle of the given name. Do not first-call frame handle getters inside GetLocalPlayer(); acquire/cache handles for all players first. For custom UI setup, prefer elapsed game time 0.00 or later.
public function createFrame(string name) returns framehandle
Creates a non simple frame of the given name (the name of the frame which must be defined in the imported fdf files). Do not create custom frames at map init; use elapsed game time 0.00 or later. Do not create frame handles only inside GetLocalPlayer(); create/cache them for all players first.
public function createFrame(string name, framehandle owner, integer priority, integer createContext) returns framehandle
Creates a non simple frame: name: the name of the frame which must be defined in the imported fdf files. owner: the parent of the frame priority: unknown createContext: the unique id assigned to the frame and its children (useful for creating multiple frames of the same name) Do not create custom frames at map init; use elapsed game time 0.00 or later. Do not create frame handles only inside GetLocalPlayer(); create/cache them for all players first.
public function createSimpleFrame(string name) returns framehandle
Creates a simple frame of the given name (the name of the frame which must be defined in the imported fdf files). Do not create custom frames at map init; use elapsed game time 0.00 or later. Do not create frame handles only inside GetLocalPlayer(); create/cache them for all players first.
public function createSimpleFrame(string name, framehandle owner, integer createContext) returns framehandle
Creates a simple frame: name: the name of the frame which must be defined in the imported fdf files. owner: the parent of the frame createContext: the unique id assigned to the frame and its children (useful for creating multiple frames of the same name) Do not create custom frames at map init; use elapsed game time 0.00 or later. Do not create frame handles only inside GetLocalPlayer(); create/cache them for all players first.
public function createFrame(string typeName, string name, framehandle owner, string inherits, integer createContext) returns framehandle
Creates a frame by type: typeName: the name of the type (e.g. “SIMPLEFRAME”, “MENU”, “BUTTON”) name: the name of the created frame owner: the parent of the frame inherits: the name of the frame frome which the created frame will be inhereting (which must be defined in the imported .fdf files) createContext: the unique id assigned to the frame and its children (useful for creating multiple frames of the same name) Do not create custom frames at map init; use elapsed game time 0.00 or later. Do not create frame handles only inside GetLocalPlayer(); create/cache them for all players first.
public function createBackdrop(string name, framehandle owner, integer createContext) returns framehandle
Creates a BACKDROP frame by type without requiring custom FDF. Use this for simple images, borders and background panels.
public function createTextFrame(string name, framehandle owner, integer createContext) returns framehandle
Creates a TEXT frame by type without requiring custom FDF.
public function createTextTooltip(string name, framehandle owner, string text, integer createContext) returns framehandle
Creates a disabled TEXT tooltip frame by type without requiring custom FDF. After positioning the tooltip, call owner.setTooltip(tooltip).
public function createGlueTextButton(string name, framehandle owner, string inheritTemplate, integer createContext) returns framehandle
Creates a GLUETEXTBUTTON by type without requiring custom FDF. inheritTemplate is commonly “ScriptDialogButton” for Blizzard’s default dialog button style.
public function getCommandButton(int index) returns framehandle
Returns the named command button frame. In WC3 1.32+, moving command buttons through origin frames can glitch, so the named frames are usually safer.
public function getInventoryButton(int index) returns framehandle
Returns the named inventory button frame. In WC3 1.32+, moving item buttons through origin frames can glitch, so the named frames are usually safer.
public function enableUIAutoPosition(bool flag)
Enables or disables auto positioning of ui elements
public function setOriginFramesVisible(bool flag)
Hides or shows all origin frames except ORIGIN_FRAME_WORLD_FRAME
public function hideOriginFrames()
Hides all origin frames except ORIGIN_FRAME_WORLD_FRAME
public function showOriginFrames()
Shows all origin frames except ORIGIN_FRAME_WORLD_FRAME
public function loadTOCFile(string tocFile) returns bool
Loads a toc file from the given path, to include custom fdf files from, returns true on success. Load the TOC before creating or inheriting templates from it. TOC order matters: list included/base FDF files before FDF files that depend on them. TOC file endings are fragile; keep at least one empty final line for CRLF files and two for LF-only files.
public function getFullscreenFrameWidth() returns real
Returns the local fullscreen frame width in Warcraft III UI coordinate units. A fullscreen reference frame usually uses this width and height 0.6, anchored by FRAMEPOINT_BOTTOM at (0.4, 0.0). The value depends on the local client’s aspect ratio and can differ per player.
public function getFullscreenFrameSize() returns vec2
Returns the local fullscreen frame size in Warcraft III UI coordinate units. The value depends on the local client’s aspect ratio and can differ per player.
public function setMousePos(vec2 pos)
Places the mouse cursor at the given point of the screen. Uses the same coodinate system as framehandles
public function setMousePos(integer x, integer y)
Places the mouse cursor at the given point of the screen. Uses the window’s coordinate system (in pixels) where (0, 0) is top-left corner of the window and positive direction of Y axis is “down”
public function enableCursor()
public function disableCursor()
public function setCursorEnabled(bool flag)
public function framehandle.destroyUnsafe()
Destroys a frame. Unsafe for most multiplayer UI because destroying frames can desync or destabilize frame state after save/load. Do not call on String or Texture SimpleFrame children. Prefer hide(), disable() and reuse cached frames.
public function framehandle.remove()
public function framehandle.setCenter()
Places the frame at the center of the screen
public function framehandle.setAbsPoint(framepointtype point, real x, real y)
Sets the frame position to an absolute x, y point on the screen. For the x-axis, the normal 4:3 UI range is 0.0 to 0.8. For the y-axis, the normal 4:3 UI range is 0.0 to 0.6. Some SimpleFrames and specially parented frames can leave this area.
public function framehandle.setAbsPoint(framepointtype point, vec2 pos)
Sets the frame position to an absolute x, y point on the screen. For the x-axis, the normal 4:3 UI range is 0.0 to 0.8. For the y-axis, the normal 4:3 UI range is 0.0 to 0.6. Some SimpleFrames and specially parented frames can leave this area.
public function framehandle.clearAndSetAbsPoint(framepointtype point, real x, real y)
Clears all existing anchors and then places the frame at an absolute screen point. This is the safer default when repositioning existing/default frames.
public function framehandle.clearAndSetAbsPoint(framepointtype point, vec2 pos)
Clears all existing anchors and then places the frame at an absolute screen point. This is the safer default when repositioning existing/default frames.
public function framehandle.setPoint(framepointtype point, framehandle relative, framepointtype relativePoint)
Sets the frame’s anchor point position to the one of the given frame’s anchor
public function framehandle.setPoint(framepointtype point, framehandle relative, framepointtype relativePoint, vec2 offset)
Sets the frame’s anchor point position to the one of the given frame’s anchor with an offset
public function framehandle.setPoint(framepointtype point, framehandle relative, framepointtype relativePoint, real offsetX, real offsetY)
Sets the frame’s anchor point position to the one of the given frame’s anchor with an offset
public function framehandle.clearAndSetPoint(framepointtype point, framehandle relative, framepointtype relativePoint)
Clears all existing anchors and then anchors this frame to another frame. This is the safer default when repositioning existing/default frames.
public function framehandle.clearAndSetPoint(framepointtype point, framehandle relative, framepointtype relativePoint, vec2 offset)
Clears all existing anchors and then anchors this frame to another frame with an offset. This is the safer default when repositioning existing/default frames.
public function framehandle.clearAndSetPoint(framepointtype point, framehandle relative, framepointtype relativePoint, real offsetX, real offsetY)
Clears all existing anchors and then anchors this frame to another frame with an offset. This is the safer default when repositioning existing/default frames.
public function framehandle.clearAllPoints()
Frees the frame from any relative or absolute anchor points
public function framehandle.setAllPoints(framehandle relative)
Copy all the anchor points of the given frame
public function framehandle.setVisible(bool flag)
Shows or hides the frame. Do not call on String or Texture SimpleFrame children.
public function framehandle.setVisible(player p, bool flag)
Shows or hides the frame to the given player. This is a local visual update; acquire/create the frame handle for all players before using player-local changes.
public function framehandle.show()
Shows the frame
public function framehandle.show(player p)
Shows the frame to the specific player
public function framehandle.hide()
Hides the frame
public function framehandle.hide(player p)
Hides the frame to the specific player
public function framehandle.hideAndDisable()
Hides and disables the frame so it cannot block mouse input while invisible.
public function framehandle.hideAndDisable(player p)
Hides and disables the frame for the specific player so it cannot block mouse input while invisible.
public function framehandle.showAndEnable()
Shows and enables the frame.
public function framehandle.showAndEnable(player p)
Shows and enables the frame for the specific player.
public function framehandle.isVisible() returns bool
Returns whether the frame is visible or not. This is local UI state and can differ per player. Do not use it directly for synced game logic.
public function framehandle.isVisible(player p) returns boolean
Returns whether the frame is visible or not for given player. This is local UI state and can differ per player. Do not use it directly for synced game logic.
public function framehandle.getName() returns string
Returns the frame’s name
public function framehandle.click()
Fires a click a event on the frame
public function framehandle.getText() returns string
Returns the text value of the text frame. This is local UI state and can differ per player. Use BlzGetTriggerFrameText() inside editbox frame events for synced input.
public function framehandle.setText(string text)
Sets the text value of the text frame
public function framehandle.setText(player p, string text)
Sets the text value of the text frame for the specific player. This is a local visual update; acquire/create the frame handle for all players before using player-local changes.
public function framehandle.getTextSizeLimit() returns integer
Returns the maximum allowed text size of the text frame
public function framehandle.setTextSizeLimit(integer size)
Sets the maximum allowed text size of the text frame. Editbox event text returned by BlzGetTriggerFrameText() is limited by Warcraft III to roughly 255 characters.
public function framehandle.setTextColor(colorA color)
Sets the text color of the text frame. The color channels are expected in the range 0 to 255.
public function framehandle.setTextColor(integer color)
Sets the text color of the text frame as a packed Warcraft III color integer.
public function framehandle.setFocus(bool flag)
Enables or disables the user interaction for the frame. Do not call on String or Texture SimpleFrame children.
public function framehandle.setFocus(player p, bool flag)
Enables or disables the user interaction for the frame for given player. This is a local visual update; acquire/create the frame handle for all players before using player-local changes.
public function framehandle.unfocus()
Removes the focus from a given frame by disable and instantly enabling it. Mandatory for Frames of type ‘SIMPLE’
public function framehandle.unfocus(player p)
Removes the focus from a given frame by disable and instantly enabling it for given player. Mandatory for Frames of type ‘SIMPLE’
public function framehandle.releaseKeyboardFocus()
Releases keyboard focus from a clicked frame by toggling enable state and clearing focus. Useful for buttons and editboxes that would otherwise steal Warcraft III hotkeys.
public function framehandle.releaseKeyboardFocus(player p)
Releases keyboard focus from a clicked frame for the specific player by toggling enable state and clearing focus.
public function framehandle.setModel(string modelFile, integer cameraIndex)
Sets the model of the model frame
public function framehandle.isEnabled() returns bool
Returns the state of the frame. This is local UI state and can differ per player. Do not use it directly for synced game logic.
public function framehandle.isEnabled(player p) returns boolean
Returns the state of the frame for given player. This is local UI state and can differ per player. Do not use it directly for synced game logic.
public function framehandle.setEnabled(bool enabled)
Enables or disables the frame. Do not call on String or Texture SimpleFrame children. Disable non-interactive text/backdrops to keep them from blocking mouse input.
public function framehandle.enable()
Enables the frame
public function framehandle.disable()
Disables the frame
public function framehandle.enable(player p)
Enables the frame for the player p. This is a local visual update; acquire/create the frame handle for all players before using player-local changes.
public function framehandle.disable(player p)
Disables the frame for the player p. This is a local visual update; acquire/create the frame handle for all players before using player-local changes.
public function framehandle.getAlpha() returns int
Returns the alpha value of the frame in the range 0 to 255, for frame types that support alpha. This is local UI state and can differ per player. Do not use it directly for synced game logic.
public function framehandle.setAlpha(integer alpha)
Sets the alpha value of the frame in the range 0 to 255, for frame types that support alpha. Verified to work on backdrops, images and glue buttons (on a glue button the fade covers the whole button, child backdrops included). Apply it AFTER the frame has been parented, anchored and sized: alpha set on a freshly created frame before a layout positions it is wiped, so set it once the frame is in its final place. Reads as “disabled” to players, so prefer it for genuinely inactive elements rather than as a “selected / active” highlight. Do not call on String or Texture SimpleFrame children.
public function framehandle.setAlpha(player p, integer alpha)
Sets the alpha value of the frame in the range 0 to 255 for the given player, for frame types that support alpha. Do not call on String or Texture SimpleFrame children.
public function framehandle.setSpriteAnimate(integer primaryProp, integer flags)
Unknown
public function framehandle.setTexture(string texFile, integer flag, bool blend)
Sets the texture of the frame. texFile: the path of the texture flag: texture flag passed to BlzFrameSetTexture, usually 0 blend: true to keep transparency
public function framehandle.setTexture(player p, string texFile, integer flag, bool blend)
Sets the texture of the frame for the specific player texFile: the path of the texture flag: texture flag passed to BlzFrameSetTexture, usually 0 blend: true to keep transparency This is a local visual update; acquire/create the frame handle for all players before using player-local changes.
public function framehandle.setScale(real scale)
Sets the frame’s scaling value. Frame’s size, children frames and relative anchor point offsets scale. Do not call on String or Texture SimpleFrame children.
public function framehandle.setTooltip(framehandle tooltip)
Sets a frame’s tooltip frame, if it has some tooltip subframe. Tooltip owner and tooltip frame should belong to the same Frame/SimpleFrame group. This cannot really be undone, and calling it repeatedly with the same owner/tooltip pair can crash on hover.
public function framehandle.cageMouse(bool enable)
Forces the mouse cursor to stay (caged) inside of the frame
public function framehandle.getValue() returns real
Returns the specific value of the frame, e.g. for sliders. This is local UI state and can differ per player. Prefer BlzGetTriggerFrameValue() inside frame events for synced input.
public function framehandle.setValue(real value)
Sets the specific value of the frame (e.g. for sliders)
public function framehandle.setMinMax(real minValue, real maxValue)
Sets the specific minimum and maximum value of the frame (e.g. for sliders)
public function framehandle.setStepSize(real stepSize)
Sets the step size of the frame (e.g. for sliders)
public function framehandle.setWidth(real width)
Sets the width of the frame in UI coordinate units, preserving its current height. The current height is local UI state and can differ per player.
public function framehandle.setHeight(real height)
Sets the height of the frame in UI coordinate units, preserving its current width. The current width is local UI state and can differ per player.
public function framehandle.setSize(real width, real height)
Sets the width and height of the frame in UI coordinate units.
public function framehandle.setVertexColor(color pcolor)
Tints a MODEL or sprite frame by its vertex colour; channels in the range 0 to 255. This does NOT recolour ordinary UI textures: verified in-game to have no visible effect on a BACKDROP, an image (which is a backdrop), or a glue button. To recolour such elements, swap the texture (setTexture) or use a differently coloured FDF backdrop; for text use the font colour or
cAARRGGBB ... |r colour codes.
public function framehandle.setVertexColor(colorA color)
Sets the vertex colour (with alpha) of a MODEL or sprite frame; channels in the range 0 to 255. Model/sprite only: it does not recolour BACKDROP / image / glue-button UI textures (see the color overload above).
public function framehandle.setVertexColor(integer color)
Sets the vertex colour of a MODEL or sprite frame as a packed Warcraft III colour integer. Model/sprite only: it does not recolour BACKDROP / image / glue-button UI textures.
public function framehandle.setLevel(integer level)
If multiple frames cover each other, the one with the highest level will receive mouse events and will be drawn above the others. If several frames have the same level, the last created one is prioritized. Do not call on String or Texture SimpleFrame children.
public function framehandle.getParent() returns framehandle
Searches for the frames parent frame. Should be used with caution as getting the parent of any top most frame will lead into a void crash
public function framehandle.setParent(framehandle parent)
Sets the parent frame of the frame. Do not mix Frame and SimpleFrame groups, and never set a frame’s parent to itself or one of its descendants.
public function framehandle.getHeight() returns real
Returns the frame’s height in UI coordinate units. This is local UI state and can differ per player. Do not use it directly for synced game logic.
public function framehandle.getWidth() returns real
Returns the frame’s width in UI coordinate units. This is local UI state and can differ per player. Do not use it directly for synced game logic.
public function framehandle.setFont(string fileName, real height, integer flags)
Sets the text font of the text frame. Use for TEXT frames and String SimpleFrame children. Calling it on generic SimpleFrames can crash.
public function framehandle.setTextAlignment(textaligntype vert, textaligntype horz)
Set the text alignment of the text frame
public function framehandle.setFullscreenReference()
Sizes and positions this frame as a fullscreen reference frame. The size depends on the local client’s aspect ratio and can differ per player.
public function framehandle.setMousePos()
Places the mouse cursor in the center of the frame
public function framehandle.getChildrenCount() returns int
Get number of children frames of given frame. Only direct child frames are counted
public function framehandle.getChild(int index) returns framehandle
Get child frame handle from given index. The index must be in the range 0 <= index < getChildrenCount(). Out-of-bounds access can crash.
public constant GAME_UI = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0)
public constant WORLD_UI = BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0)
public constant CONSOLE_UI = BlzGetFrameByName("ConsoleUIBackdrop", 0)
public constant SCREEN_CENTER = vec2(0.4, 0.3)
public constant SCREEN_TOPRIGHT = vec2(0.8, 0.6)
public constant SCREEN_TOPLEFT = vec2(0.0, 0.6)
public constant SCREEN_BOTTOMRIGHT = vec2(0.8, 0.0)
public constant SCREEN_BOTTOMLEFT = vec2(0.0, 0.0)
public constant SCREEN_RIGHT = vec2(0.8, 0.3)
public constant SCREEN_LEFT = vec2(0.0, 0.3)
public constant SCREEN_TOP = vec2(0.4, 0.6)
public constant SCREEN_BOTTOM = vec2(0.4, 0.0)
public constant WHOLE_SCREEN_TOPRIGHT = vec2( 0.95, 0.6)
public constant WHOLE_SCREEN_TOPLEFT = vec2(-0.15, 0.6)
public constant WHOLE_SCREEN_BOTTOMRIGHT = vec2( 0.95, 0.0)
public constant WHOLE_SCREEN_BOTTOMLEFT = vec2(-0.15, 0.0)
public constant WHOLE_SCREEN_RIGHT = vec2( 0.95, 0.3)
public constant WHOLE_SCREEN_LEFT = vec2(-0.15, 0.3)
public constant WHOLE_SCREEN_TOP = SCREEN_TOP
public constant WHOLE_SCREEN_BOTTOM = SCREEN_BOTTOM