WoW:XML/Frame: Difference between revisions

105 bytes added ,  27 October 2005
No edit summary
Line 11: Line 11:


=== Game Interaction ===
=== Game Interaction ===
Most of the useful information comes from game events, which are all passed to the frame via the generic <OnEvent> script handler. There are literally hundreds of types of Game Events, so rather than spent a lot of time passing every event to every handler, an AddOn must register its interest in a frame receiving a certain event. This is accomplished through the [[API RegisterEvent|Frame:RegisterEvent("event")]] function, and is typically performed within the <OnLoad> or <OnShow> handlers.
Most of the useful information comes from game events, which are all passed to the frame via the generic <OnEvent> script handler. There are literally hundreds of types of Game Events, so rather than spend a lot of time passing every event to every handler, an AddOn must register its interest in a frame receiving a certain event. This is accomplished through the [[API RegisterEvent|Frame:RegisterEvent("event")]] function, and is typically performed within the <OnLoad> or <OnShow> handlers.
Once an event has been registered, the Frame's <OnEvent> handler will be called whenever that event occurs.
Once an event has been registered, the Frame's <OnEvent> handler will be called whenever that event occurs.


Line 30: Line 30:
Frame levels are that which determines what frame will be on top of other frame. Each frame has a frame level value. If frame A is placed in the same area as frame B, then the frame with the highest frame level will be on top of the other frame.
Frame levels are that which determines what frame will be on top of other frame. Each frame has a frame level value. If frame A is placed in the same area as frame B, then the frame with the highest frame level will be on top of the other frame.


Instead of going around and specifying that frame A should have frame level 12, and frame B frame level 15, Blizzard uses a set of predefined "groups" of frame levels called frameStrata. The valid values for frameStrata are "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN_DIALOG" and "TOOLTIP" (there may be more). Note that the order they are listed in is the assumed ascendancy (i.e. it is assumed that "BACKGROUND" will be below "LOW").
Instead of going around and specifying that frame A should have frame level 12, and frame B frame level 15, Blizzard uses a set of predefined "groups" of frame levels called frameStrata. The valid values for frameStrata are "PARENT", "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN_DIALOG" and "TOOLTIP" (there may be more). For the values "BACKGROUND" through "TOOLTIP" the values are listed in their assumed ascendancy (i.e. it is assumed that "BACKGROUND" will be below "LOW").  The default value is "PARENT" if no frameStrata is specified.


There is also a special attribute called toplevel - this means (hopefully) that the frame should be on top of any other frame (or, possibly, on top of any other frame in the same frameStrata). Valid values are "false" and "true".
There is also a special attribute called toplevel - this means (hopefully) that the frame should be on top of any other frame (or, possibly, on top of any other frame in the same frameStrata). Valid values are "false" and "true".


[[Category:Interface Customization]]
[[Category:Interface Customization]]
Anonymous user