#
Class: FrameWarcraft III's UI uses a proprietary format known as FDF (Frame Definition Files). This class provides the ability to manipulate and create them dynamically through code.
example
Create a simple button.
// Create a "GLUEBUTTON" named "Facebutton", the clickable Button, for game UIconst buttonFrame = new Frame("FaceButton", Frame.fromOrigin(ORIGIN_FRAME_GAME_UI, 0), 0, 0, "GLUEBUTTON", "");
// Create a BACKDROP named "FaceButtonIcon", the visible image, for buttonFrame.const buttonIconFrame = new Frame("FaceButton", buttonFrame, 0, 0, "BACKDROP", "");
// buttonIconFrame will mimic buttonFrame in size and positionbuttonIconFrame.setAllPoints(buttonFrame);
// Set a TexturebuttonIconFrame.setTexture("ReplaceableTextures\\CommandButtons\\BTNSelectHeroOn", 0, true);
// Place the buttonFrame to the center of the screenbuttonFrame.setAbsPoint(FRAMEPOINT_CENTER, 0.4, 0.3);
// Give that buttonFrame a sizebuttonFrame.setSize(0.05, 0.05);
There are many aspects to modifying the UI and it can become complicated, so here are some guides:
https://www.hiveworkshop.com/threads/ui-frames-starting-guide.318603/ https://www.hiveworkshop.com/pastebin/913bd439799b3d917e5b522dd9ef458f20598/ https://www.hiveworkshop.com/tags/ui-fdf/
#
HierarchyHandle<framehandle>
↳ Frame
#
Constructors#
constructornew Frame(name: string, owner: Frame, priority: number, createContext: number): Frame
Creates a Frame.
#
Parameters:Name | Type | Description |
---|---|---|
name | string | The name of the frame to be accessed with Frame.fromName . |
owner | Frame | The parent frame. |
priority | number | |
createContext | number | The ID assigned to a frame to be accessed with Frame.fromName . This value does not have to be unique and can be overwritten. |
Returns: Frame
Defined in: handles/frame.ts:37
new Frame(name: string, owner: Frame, priority: number): Frame
Creates a SimpleFrame.
https://www.hiveworkshop.com/threads/ui-simpleframes.320385/
#
Parameters:Name | Type | Description |
---|---|---|
name | string | The name of the frame to be accessed with Frame.fromName . |
owner | Frame | The parent frame. |
priority | number |
Returns: Frame
Defined in: handles/frame.ts:45
new Frame(name: string, owner: Frame, priority: number, createContext: number, typeName: string, inherits: string): Frame
Create a Frame by type.
#
Parameters:Name | Type | Description |
---|---|---|
name | string | The name of the frame to be accessed with Frame.fromName . |
owner | Frame | The parent frame. |
priority | number | |
createContext | number | The ID assigned to a frame to be accessed with Frame.fromName . This value does not have to be unique and can be overwritten. |
typeName | string | The type of Frame. |
inherits | string | The name of the Frame it inherits. |
Returns: Frame
Defined in: handles/frame.ts:55
#
Properties#
handle• Readonly
handle: framehandle
Defined in: handles/handle.ts:6
#
Accessors#
alphaalpha(): number
Returns: number
Defined in: handles/frame.ts:86
alpha(alpha: number): void
#
Parameters:Name | Type |
---|---|
alpha | number |
Returns: void
Defined in: handles/frame.ts:82
#
childrenchildren(): Frame[]
Returns: Frame[]
Defined in: handles/frame.ts:90
#
childrenCountchildrenCount(): number
Returns: number
Defined in: handles/frame.ts:99
#
enabledenabled(): boolean
Returns: boolean
Defined in: handles/frame.ts:107
enabled(flag: boolean): void
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: void
Defined in: handles/frame.ts:103
#
heightheight(): number
Returns: number
Defined in: handles/frame.ts:115
height(height: number): void
#
Parameters:Name | Type |
---|---|
height | number |
Returns: void
Defined in: handles/frame.ts:111
#
idid(): number
Get the unique ID of the handle. The ID is recycled once you destroy the object.
Returns: number
The unique ID of a handle object.
Defined in: handles/handle.ts:18
#
parentparent(): Frame
Returns: Frame
Defined in: handles/frame.ts:123
parent(parent: Frame): void
#
Parameters:Name | Type |
---|---|
parent | Frame |
Returns: void
Defined in: handles/frame.ts:119
#
texttext(): string
Returns: string
Defined in: handles/frame.ts:131
text(text: string): void
#
Parameters:Name | Type |
---|---|
text | string |
Returns: void
Defined in: handles/frame.ts:127
#
textSizeLimittextSizeLimit(): number
Returns: number
Defined in: handles/frame.ts:139
textSizeLimit(size: number): void
#
Parameters:Name | Type |
---|---|
size | number |
Returns: void
Defined in: handles/frame.ts:135
#
valuevalue(): number
Returns: number
Defined in: handles/frame.ts:147
value(value: number): void
#
Parameters:Name | Type |
---|---|
value | number |
Returns: void
Defined in: handles/frame.ts:143
#
visiblevisible(): boolean
Returns: boolean
Defined in: handles/frame.ts:155
visible(flag: boolean): void
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: void
Defined in: handles/frame.ts:151
#
widthwidth(): number
Returns: number
Defined in: handles/frame.ts:163
width(width: number): void
#
Parameters:Name | Type |
---|---|
width | number |
Returns: void
Defined in: handles/frame.ts:159
#
Methods#
addTextaddText(text: string): Frame
#
Parameters:Name | Type |
---|---|
text | string |
Returns: Frame
Defined in: handles/frame.ts:167
#
cageMousecageMouse(enable: boolean): Frame
#
Parameters:Name | Type |
---|---|
enable | boolean |
Returns: Frame
Defined in: handles/frame.ts:172
#
clearPointsclearPoints(): Frame
Returns: Frame
Defined in: handles/frame.ts:177
#
clickclick(): Frame
Returns: Frame
Defined in: handles/frame.ts:182
#
destroydestroy(): Frame
Returns: Frame
Defined in: handles/frame.ts:187
#
getChildgetChild(index: number): Frame
#
Parameters:Name | Type |
---|---|
index | number |
Returns: Frame
Defined in: handles/frame.ts:192
#
setAbsPointsetAbsPoint(point: framepointtype, x: number, y: number): Frame
#
Parameters:Name | Type |
---|---|
point | framepointtype |
x | number |
y | number |
Returns: Frame
Defined in: handles/frame.ts:196
#
setAllPointssetAllPoints(relative: Frame): Frame
#
Parameters:Name | Type |
---|---|
relative | Frame |
Returns: Frame
Defined in: handles/frame.ts:201
#
setAlphasetAlpha(alpha: number): Frame
#
Parameters:Name | Type |
---|---|
alpha | number |
Returns: Frame
Defined in: handles/frame.ts:206
#
setEnabledsetEnabled(flag: boolean): Frame
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: Frame
Defined in: handles/frame.ts:211
#
setFocussetFocus(flag: boolean): Frame
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: Frame
Defined in: handles/frame.ts:216
#
setFontsetFont(filename: string, height: number, flags: number): Frame
#
Parameters:Name | Type |
---|---|
filename | string |
height | number |
flags | number |
Returns: Frame
Defined in: handles/frame.ts:221
#
setHeightsetHeight(height: number): Frame
#
Parameters:Name | Type |
---|---|
height | number |
Returns: Frame
Defined in: handles/frame.ts:226
#
setLevelsetLevel(level: number): Frame
#
Parameters:Name | Type |
---|---|
level | number |
Returns: Frame
Defined in: handles/frame.ts:231
#
setMinMaxValuesetMinMaxValue(minValue: number, maxValue: number): Frame
#
Parameters:Name | Type |
---|---|
minValue | number |
maxValue | number |
Returns: Frame
Defined in: handles/frame.ts:236
#
setModelsetModel(modelFile: string, cameraIndex: number): Frame
#
Parameters:Name | Type |
---|---|
modelFile | string |
cameraIndex | number |
Returns: Frame
Defined in: handles/frame.ts:241
#
setParentsetParent(parent: Frame): Frame
#
Parameters:Name | Type |
---|---|
parent | Frame |
Returns: Frame
Defined in: handles/frame.ts:246
#
setPointsetPoint(point: framepointtype, relative: Frame, relativePoint: framepointtype, x: number, y: number): Frame
#
Parameters:Name | Type |
---|---|
point | framepointtype |
relative | Frame |
relativePoint | framepointtype |
x | number |
y | number |
Returns: Frame
Defined in: handles/frame.ts:251
#
setScalesetScale(scale: number): Frame
#
Parameters:Name | Type |
---|---|
scale | number |
Returns: Frame
Defined in: handles/frame.ts:256
#
setSizesetSize(width: number, height: number): Frame
#
Parameters:Name | Type |
---|---|
width | number |
height | number |
Returns: Frame
Defined in: handles/frame.ts:261
#
setSpriteAnimatesetSpriteAnimate(primaryProp: number, flags: number): Frame
#
Parameters:Name | Type |
---|---|
primaryProp | number |
flags | number |
Returns: Frame
Defined in: handles/frame.ts:266
#
setStepSizesetStepSize(stepSize: number): Frame
#
Parameters:Name | Type |
---|---|
stepSize | number |
Returns: Frame
Defined in: handles/frame.ts:271
#
setTextsetText(text: string): Frame
#
Parameters:Name | Type |
---|---|
text | string |
Returns: Frame
Defined in: handles/frame.ts:276
#
setTextColorsetTextColor(color: number): Frame
#
Parameters:Name | Type |
---|---|
color | number |
Returns: Frame
Defined in: handles/frame.ts:281
#
setTextSizeLimitsetTextSizeLimit(size: number): Frame
#
Parameters:Name | Type |
---|---|
size | number |
Returns: Frame
Defined in: handles/frame.ts:286
#
setTexturesetTexture(texFile: string, flag: number, blend: boolean): Frame
#
Parameters:Name | Type |
---|---|
texFile | string |
flag | number |
blend | boolean |
Returns: Frame
Defined in: handles/frame.ts:291
#
setTooltipsetTooltip(tooltip: Frame): Frame
#
Parameters:Name | Type |
---|---|
tooltip | Frame |
Returns: Frame
Defined in: handles/frame.ts:296
#
setValuesetValue(value: number): Frame
#
Parameters:Name | Type |
---|---|
value | number |
Returns: Frame
Defined in: handles/frame.ts:301
#
setVertexColorsetVertexColor(color: number): Frame
#
Parameters:Name | Type |
---|---|
color | number |
Returns: Frame
Defined in: handles/frame.ts:306
#
setVisiblesetVisible(flag: boolean): Frame
#
Parameters:Name | Type |
---|---|
flag | boolean |
Returns: Frame
Defined in: handles/frame.ts:311
#
setWidthsetWidth(width: number): Frame
#
Parameters:Name | Type |
---|---|
width | number |
Returns: Frame
Defined in: handles/frame.ts:316
#
autoPositionstatic autoPosition(enable: boolean): void
#
Parameters:Name | Type |
---|---|
enable | boolean |
Returns: void
Defined in: handles/frame.ts:321
#
fromEventstatic fromEvent(): Frame
Returns: Frame
Defined in: handles/frame.ts:325
#
fromHandlestatic fromHandle(handle: framehandle): Frame
#
Parameters:Name | Type |
---|---|
handle | framehandle |
Returns: Frame
Defined in: handles/frame.ts:329
#
fromNamestatic fromName(name: string, createContext: number): Frame
#
Parameters:Name | Type |
---|---|
name | string |
createContext | number |
Returns: Frame
Defined in: handles/frame.ts:333
#
fromOriginstatic fromOrigin(frameType: originframetype, index: number): Frame
#
Parameters:Name | Type |
---|---|
frameType | originframetype |
index | number |
Returns: Frame
Defined in: handles/frame.ts:337
#
getEventHandlestatic getEventHandle(): frameeventtype
Returns: frameeventtype
Defined in: handles/frame.ts:341
#
getEventTextstatic getEventText(): number
Returns: number
Defined in: handles/frame.ts:345
#
getEventValuestatic getEventValue(): number
Returns: number
Defined in: handles/frame.ts:349
#
hideOriginstatic hideOrigin(enable: boolean): void
#
Parameters:Name | Type |
---|---|
enable | boolean |
Returns: void
Defined in: handles/frame.ts:353
#
loadTOCstatic loadTOC(filename: string): boolean
#
Parameters:Name | Type |
---|---|
filename | string |
Returns: boolean
Defined in: handles/frame.ts:357