- 新的API功能 frame = CreateFrame("frameType" [,"name"] [, parent]) -- 動態創建 新的指定類型Frame font = CreateFont("name") -- 動態創建字型元件 num = GetNumFrames() -- 取得目前已創建的Frame數量 nextFrame = EnumerateFrames(currentFrame) -- 取得currentFrame之後 的Frame(內部順序,使用currentFrame=nil取得第一個Frame) seterrorhandler(errfunc) -- 設定一個新的腳本錯誤處理器(將錯誤信息作為參數的功能) errfunc = geterrorhan version, buildnum, builddate = GetBuildInfo() 新的元件方法(由所有Frame, Texture和Fontstring繼承) type = Object:GetObjectType() isType = Object:IsObjectType("type") 新的字型物件 name = Font:GetName() a = Font:GetAlpha() Font:SetAlpha(a) font = Font:GetFontObject() -- 取得字型的『parent』. Font:SetFontObject(font or nil) -- 設定字型的『parent』` Font:CopyFontObject(font) -- 設定此字型的屬性與目標字型相同 fontFile, fontHeight, flags = Font:GetFont() wasFound = Font:SetFont("fontFile", fontHeight [, flags]) -- 如果 指定字型有效,則返回1,否則nil(不作改變)。 r,g,b,a = Font:GetTextColor() Font:SetTextColor(r, g, b [, a]) r,g,b,a = Font:GetShadowColor() Font:SetShadowColor(r, g, b [, a]) x,y = Font:GetShadowOffset() Font:SetShadowOffset(x, y) Font:SetSpacing(spacing) spacing = Font:GetSpacing() Font:SetJustifyH("LEFT" or "CENTER" or "RIGHT") justifyh = Font:GetJustifyH() Font:SetJustifyV("TOP" or "MIDDLE" or "BOTTOM") justifyv = Font:GetJustifyV() 新的LayoutFrame方法(由所有Frame, Texture和Fontstring繼承) x,y = LayoutFrame:GetCenter() x = LayoutFrame:GetLeft() x = LayoutFrame:GetRight() y = LayoutFrame:GetTop() y = LayoutFrame:GetBottom() width = LayoutFrame:GetWidth() LayoutFrame:SetWidth(width) height = LayoutFrame:GetHeight() LayoutFrame:SetHeight(height) numPoints = LayoutFrame:GetNumPoints() "point",relativeObject,"relativePoint",xOfs,yOfs = LayoutFrame:GetPoint(index) LayoutFrame:SetPoint("point" [, LayoutFrame] [, "relativePoint"] [, offsetX, offsetY]) LayoutFrame:SetAllPoints(LayoutFrame) LayoutFrame:ClearAllPoints() 新的Texture方法 parent = Texture:GetParent() Texture:SetParent(parent or "parent") layer = Texture:GetDrawLayer() Texture:SetDrawLayer("layer") blendMode = Texture:GetBlendMode() Texture:SetBlendMode("blendMode") -- blendMode是"DISABLE", "BLEND", "ALPHAKEY", "ADD", "MOD"之一 r,g,b,a = Texture:GetVertexColor() isFound = Texture:SetTexture("path") -- 如果找到路徑,則返回1, 否則nil 新的FontString方法 parent = FontString:GetParent() FontString:SetParent(parent or "parent") layer = FontString:GetDrawLayer() FontString:SetDrawLayer("layer") font = FontString:GetFontObject() FontString:SetFontObject(font or nil) fontFile, fontHeight, flags = FontString:GetFont() wasFound = FontString:SetFont("fontFile", fontHeight [, flags]) -- 如果找到指定字型,則返回1,否則nil(不作改變) a = FontString:GetAlpha() r,g,b,a = FontString:GetTextColor() FontString:SetTextColor(r, g, b [, a]) r,g,b,a = FontString:GetShadowColor() FontString:SetShadowColor(r, g, b [, a]) x,y = FontString:GetShadowOffset() FontString:SetShadowOffset(x, y) spacing = FontString:GetSpacing() FontString:SetSpacing(spacing) justifyh = Font:GetJustifyH() FontString:SetJustifyH("LEFT" or "CENTER" or "RIGHT") justfiyv = FontString:GetJustifyV() FontString:SetJustifyV("TOP" or "MIDDLE" or "BOTTOM") 所有Frame的新方法 texture = Frame:CreateTexture(["name"] [,"layer"]) -- 為某個Frame創建一個新的子Texture目標 fontstring = Frame:CreateFontString(["name"] [,"layer"]) -- 為某個Frame創建一個新的子Fontstring目標 numRegions = Frame:GetNumRegions() -- 返回Frame中附加的區域數量Textures/FontStrings) a, b, c, ... = Frame:GetRegions() -- 返回Frame中附加的區域 新的MessageFrames,ScrollingMessageFrames和EditBoxes的方法 font = Frame:GetFontObject() Frame:SetFontObject(font or nil) fowasFound = Frame:SetFont("fontFile", fontHeight [, flags]) -- 如果指定font有效則返回真,否則nil(不作改變) r,g,b,a = Frame:GetTextColor() Frame:SetTextColor(r, g, b [, a]) r,g,b,a = Frame:GetShadowColor() Frame:SetShadowColor(r, g, b [, a]) x,y = Frame:GetShadowOffset() Frame:SetShadowOffset(x, y) spacing = Frame:GetSpacing() Frame:SetSpacing(spacing) justifyh = Font:GetJustifyH() Frame:SetJustifyH("LEFT" or "CENTER" or "RIGHT") justfiyv = Frame:GetJustifyV() Frame:SetJustifyV("TOP" or "MIDDLE" or "BOTTOM") 新的SimpleHTML方法 ("header" is "H1" "H2" or "H3") font = SimpleHTML:GetFontObject(["header"]) SimpleHTML:SetFontObject(["header",] font or nil) fontFile, fontHeight, flags = SimpleHTML:GetFont(["header"]) wasFound = SimpleHTML:SetFont(["header",] "fontFile", fontHeight [, flags]) -- 如果指定font有效則返回真,否則nil(不作改變) r,g,b,a = SimpleHTML:GetTextColor(["header"]) SimpleHTML:SetTextColor(["header",] r, g, b [, a]) r,g,b,a = SimpleHTML:GetShadowColor(["header"]) SimpleHTML:SetShadowColor(["header",] r, g, b [, a]) x,y = SimpleHTML:GetShadowOffset(["header"]) SimpleHTML:SetShadowOffset(["header",] x, y) spacing = SimpleHTML:GetSpacing(["header"]) SimpleHTML:SetSpacing(["header",] spacing) justifyh = SimpleHTML:GetJustifyH(["header"]) SimpleHTML:SetJustifyH(["header",] "LEFT" or "CENTER" or "RIGHT") justfiyv = SimpleHTML:GetJustifyV(["header"]) SimpleHTML:SetJustifyV(["header",] "TOP" or "MIDDLE" or "BOTTOM") 新的Button方法 font = Button:GetTextFontObject() Button:SetTextFontObject(font or nil) font = Button:GetDisabledFontObject() Button:SetDisabledFontObject(font or nil) font = Button:GetHighlightFontObject() Button:SetHighlightFontObject(font or nil) Button:SetNormalTexture("texturePath" or TextureObject) -- 新增了Texture對像選項 Button:SetPushedTexture("texturePath" or TextureObject) -- 新增了Texture對像選項 Button:SetDisabledTexture("texturePath" or TextureObject) -- 新增了Texture對像選項 Button:SetHighlightTexture("texturePath" or TextureObject) -- 新增了Texture對像選項 新的Slider方法 orientation = Slider:GetOrientation() -- 返回slider定位 Slider:SetOrientation("orientation") -- 設定slider定位 ("HORIZONTAL","VERTICAL") 新的StatusBar方法 orientation = StatusBar:GetOrientation() -- 返回bar定位 StatusBar:SetOrientation("orientation") -- 設定bar定位 ("HORIZONTAL","VERTICAL") filename = StatusBar:GetStatusBarTexture() r, g, b, a = StatusBar:GetStatusBarColor() 新的ScrollingMessageFrame方法 ScrollingMessageFrame:SetFading(isFading) -- 從ScrollingMessageFrame:EnableFading()重命名而來isFading = ScrollingMessageFrame:GetFading() duration = ScrollingMessageFrame:GetFadeDuration() -- 取得字符串消隱的時長 visTime = ScrollingMessageFrame:GetTimeVisible() -- 取得字符串 消隱前的時長 新的Minimap方法 Minimap:SetMaskTexture("file") -- 為小地圖遮蔽設定texture Minimap:SetIconTexture("file") -- 為小地圖POI圖示設定texture Minimap:SetBlipTexture("file") -- 為小地圖追蹤箭頭設定texture |