AddOn Studio Wiki:API notation and conventions
Links from World of Warcraft API et alEdit
Example API listingEdit
- SetMapZoom(continentIndex[, zoneIndex]) - Sets the current world map to a specific continent and optionally zone.
- This function takes one or two arguments. The square brackets indicate that the second argument is optional.
Example API with string argumentEdit
- SetChannelOwner("channel", "name") - Sets the channel owner.
- The quotes around the arguments in this function means that the parameter is a string. It does not mean that the argument is literally "channel" or "name".
Example API with described data type (string)Edit
- TargetUnit("unit") - Selects the specified id as the current target.
Example of an UI Object (widget) methodEdit
- LayoutFrame:SetAllPoints(frame or "frameName") - Set all anchors to match edges of specified frame
- This example shows that the SetAllPoints() function is called as a method function on a LayoutFrame object. The arguemnt is either a frame, or a frame name (string).
Link Code ExamplesEdit
: [[API SetMapZoom|SetMapZoom]](continentIndex[,zoneIndex]) - Description
- Pages describing individual API functions are named on the form "API FunctionName" (with no argument information).
: [[API LayoutFrame GetHeight|LayoutFrame:GetHeight]]() - Description
- Pages describing individual widget methods are named on the form "API ObjectType FunctionName" (with no argument information).
Link PrefixesEdit
- PROTECTED - function exists, but is protected for Blizzard only code.
- If the page exists, put {{protectedapi|<version when it was protected>|<extra info, if appropriate>}} at the top
- REMOVED - indicates that the function has been removed from the API.
- Removed functions should only be listed in Category:World of Warcraft API/Removed Functions
- If the page exists, put {{removedapi|<version when it was removed>|<what to use instead, if appropriate>}} at the top
- UI - indicates that the function is provided by the FrameXML UI code, rather than the core API.
- If the page exists, put {{framexmlfunc|<FrameXML/FileNameWhereFunctionIs.lua>}} at the top
Data and Argument TypesEdit
The API uses special values for some function arguments, the commonly used types are:
[edit]
API typesCategory:API types has the full list. (Though if something there is not available here: please list it!)