Frame Reference
Total Page:16
File Type:pdf, Size:1020Kb
APPENDIX A Frame Reference This appendix contains information on all the frame types that you can create in World of Warcraft, with all the XML attributes and elements as well as all Lua methods and available script handlers. Frame types follow an object-oriented model, meaning that a frame type can inherit attributes and methods from another frame type. You can find an introduction to object-oriented programming in Chapter 6 if you are not familiar with this topic. You may wonder why there is such an appendix in this book, as you can probably find most of the information covered here on the Internet. WoWWiki has a few good pages that deal with exactly the same topic as this appendix. However, the information there is scattered over multiple pages and many of the articles are outdated or incomplete. This appendix is up to date as of patch 3.1 (the next patches probably won’t change anything important in the frame API) and contains everything you need to know about a particular frame type in one place. Object K^fa_p is an abstract frame type; that is, you cannot create frames from this type. But this type is the base class for all other frame types as every other type inherits from K^fa_p. This means that all of the methods, XML attributes, and XML elements listed here are available for all frames. This frame type is sometimes also called QEK^fa_p, which is probably the type’s internal name used in the C++ code of the game. XML Attributes The K^fa_p type has the following XML attributes. ]hld] Defines the frame’s transparency (0 – 1). Default: 1. 405 406 APPENDIX A N FRAME REFERENCE l]najp Defines the frame’s parent. j]ia Defines the frame’s name. ejdanepo The template to use. renpq]h Creates a template. Default: b]hoa. Lua Methods The K^fa_p type has the following Lua methods. k^fa_p6Cap=hld]$% Returns the frame’s alpha value. k^fa_p6CapAbba_pera=hld]$% Returns the frame's effective alpha value by multiplying its alpha value with the parent’s effective alpha. k^fa_p6CapJ]ia$% Returns the name of the frame. k^fa_p6CapK^fa_pPula$% Returns the type of the k^fa_p. k^fa_p6CapL]najp$% Returns the parent of the frame. k^fa_p6EoK^fa_pPula$k^fPula% Returns 1 if k^fa_p is of the type k^fPula, or of a type that inherits from k^fPula. For example, ?na]paBn]ia$?da_g>qppkj%6EoK^fa_pPula$>qppkj% returns 1 because the type ?da_g>qppkj inherits from the type >qppkj. k^fa_p6Oap=hld]$% Sets the frame’s transparency (0 – 1). APPENDIX A N FRAME REFERENCE 407 k^fa_p6OapL]najp$k^f% Sets the frame’s parent. Font Bkjp is an object that inherits from K^fa_p and represents a font that can be used by BkjpOpnejcs or >qppkjs. XML Attributes The Bkjp type has the following XML attributes. bkjp The path to the font file you want to use. fqopebuD Sets the horizontal justification setting. This can either be HABP, NECDP, or ?AJPAN. Default: ?AJPAN. fqopebuR Sets the vertical justification setting. This can either be >KPPKI, PKL, or IE@@HA. Default: IE@@HA. ikjk_dnkia Uses a monochrome font. Default: b]hoa. kqpheja The outline to use; can be JKJA, JKNI=H, or PDE?G. Default: JKJA. ol]_ejc The spacing between characters. Default: 0. XML Elements The Bkjp type has the following XML elements. BkjpDaecdp Controls the height of the font with its R]hqa attribute. ?khkn Controls the color of the font with its n, c, ^, and ] attributes. 408 APPENDIX A N FRAME REFERENCE Od]`ks Contains the two elements ?khkn and Kbboap. ?khkn controls the color with the attributes n, c, ^, and ], and Kbboap controls the shadow offset with one of the elements =^o@eiajoekj or Nah@eiajoekj. Lua Methods The Bkjp type has the following Lua methods. bkjp6?kluBkjpK^fa_p$kpdanK^fa_p% Copies all settings from kpdanK^fa_p. bkjp6CapBkjp$% Returns the font file used. bkjp6CapBkjpK^fa_p$% Returns the font object itself. This method makes sense when called from a frame that inherits from Bkjp. bkjp6CapFqopebuD$% Returns the horizontal alignment of the text. bkjp6CapFqopebuR$% Returns the vertical alignment of the text. bkjp6CapIqhpehejaEj`ajp$% Returns the multiline indention setting. bkjp6CapOd]`ks?khkn$% Returns the color of the font’s shadow. bkjp6CapOd]`ksKbboap$% Returns the offset of the shadow. bkjp6CapOl]_ejc$% Returns the spacing between characters. bkjp6CapPatp?khkn$% Returns the color of the text. APPENDIX A N FRAME REFERENCE 409 bkjp6OapBkjp$l]pd% Sets the font file to use. bkjp6OapBkjpK^fa_p$bkjp% This method makes sense only when called from a frame (such as a Iaoo]caBn]ia) that inherits from a Bkjp. This method can then set or change the used font object for the text of the frame. bkjp6OapFqopebuD$]hecj% Sets the horizontal justification setting. The ]hecj argument can be HABP, NECDP, or ?AJPAN. bkjp6OapFqopebuR$]hecj% Sets the vertical justification setting. The ]hecj argument can be PKL, >KPPKI, or IE@@HA. bkjp6OapIqhpehejaEj`ajp$ej`ajp% Controls whether to indent the continuation of a string that does not fit in a single line. bkjp6OapOd]`ks?khkn$n(c(^(]% Sets the color of the shadow. bkjp6OapOd]`ksKbboap$t(u% Sets the offset of the shadow. bkjp6OapOl]_ejc$j% Sets the spacing between characters. bkjp6OapPatp?khkn$n(c(^(]% Sets the color of the text. Region Nacekj inherits from K^fa_p. The only way to create a Nacekj is by calling bn]ia6 ?na]paPephaNacekj$% or using the XML element PephaNacekj of a frame; you cannot use ?na]paBn]ia to create a Nacekj. It is the base class for everything that is visible on your screen (Bn]ia, Patpqna, and so on), as it defines sizes and anchors. XML Attributes The Nacekj type has the following XML attributes. oap=hhLkejpo Fits the frame into its parent. Default: b]hoa. 410 APPENDIX A N FRAME REFERENCE de``aj Defines whether the frame starts visible or hidden. Default: b]hoa. XML Elements The Nacekj type has the following XML elements. Oeva Oeva consists of either the element =^o@eiajoekj or Nah@eiajoekj. The former refers to an absolute size that depends only on the effective scale of the frame, while the latter refers to a size relative to the whole screen. Both have the attributes t and u that specify the actual size. A detailed description can be found in Chapter 5. =j_dkno Consists of one or more Anchor elements. An anchor has the attributes Lkejp, Nah]peraLkejp, and Nah]peraPk and the element Kbboap which, like Oeva, consists of =^o@eiajoekj or Nah@eiajoekj and specifies the offset. A detailed description can be found in Chapter 5. Lua Methods The Nacekj type has the following Lua methods. nacekj6?ha]n=hhLkejpo$% Removes all points but does not change the position. You have to set a new point in order to move the frame. nacekj6Cap>kppki$% Returns the y coordinate of the frame’s bottom. nacekj6Cap?ajpan$% Returns the x and y coordinates of the frame’s center. nacekj6CapDaecdp$% Retrieves the frame’s height. nacekj6CapHabp$% Returns the x coordinate of the frame’s left border. nacekj6CapJqiLkejpo$% Returns the number of anchor points. APPENDIX A N FRAME REFERENCE 411 nacekj6CapLkejp$j% Retrieves the jth point of the frame. The return values are equivalent to the arguments passed to OapLkejp when creating the anchor. nacekj6CapNa_p$% Returns the frame’s bottom left x and y coordinates followed by the width and height. nacekj6CapPkl$% Returns the y coordinate of the frame’s top. nacekj6CapSe`pd$% Returns the width of the frame. nacekj6De`a$% Hides the frame. nacekj6EoLnkpa_pa`$% Returns 1 if the frame is a protected frame. nacekj6EoOdksj$% Determines whether the frame is shown. This does not take the frame’s parent into account; see EoReoe^ha. nacekj6EoReoe^ha$% Determines whether the frame and all of its parents (and grandparents, and so on) are shown. nacekj6Oap=hhLkejpo$bn]ia% Stretches the frame to fit into bn]ia. nacekj6OapDaecdp$daecdp% Sets the frame’s height. nacekj6OapLkejp$lkejp(nah]peraBn]ia(nah]peraLkejp(t(u% Adds an anchor point. See Chapter 5 for a detailed description. nacekj6OapSe`pd$se`pd% Sets the frame’s width. 412 APPENDIX A N FRAME REFERENCE nacekj6Opkl=jei]pejc$% Stops all currently playing animations. nacekj6Cap=jei]pekjCnkqlo$% Returns all animation groups of the frame. nacekj6?na]pa=jei]pekjCnkql$j]ia(ejdanepo% Creates a new animation group for the frame. nacekj6Eo@n]ccejc$% Determines whether the user is currently dragging the frame or its parent. nacekj6?]j?d]jcaLnkpa_pa`Op]pa$% Determines whether you are allowed to call a protected method from tainted code at the moment. Frame Bn]ia inherits from Nacekj, which means it has all the methods and attributes of K^fa_p and Nacekj. XML Attributes The Bn]ia type has the following XML attributes. pklharah Fits the frame into its parent. Default: b]hoa. ikr]^ha Defines whether the frame starts visible or hidden. Default: b]hoa. naoev]^ha Makes the frame resizable. Default: b]hoa. bn]iaOpn]p] Defines the frame strata. Frame strata are described in Chapter 5. bn]iaharah Defines the level of the frame. APPENDIX A N FRAME REFERENCE 413 aj]^haIkqoa Enables mouse input. Default: b]hoa. aj]^haGau^k]n` Enables keyboard input. Default: b]hoa. _h]ila`PkO_naaj Prevents the frame from being dragged off the screen. Default: b]hoa. fqilJ]rec]paAj]^ha` Allows the element to be selected with a gamepad or joystick. fqilJ]rec]paOp]np Sets the frame as first frame to be selected when using a gamepad or joystick.