StatFrameLib-1.0

From WowAce Wiki
Jump to: navigation, search

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.

:AddStatFrame("frame_name" , "frame_label")

Arguments

"frame_name"
string - name of the frame to add. This is the programmatic name, not the label.
"frame_label"
string - label for the frame.

Notes

  • Adds a stat frame to the dropdown list.
  • Should be added on enable, not on load - frames will be dropped on suspend
  • You MUST have a method for painting the frame. This will be a method

on your object named Paint[frame name]. So if you called AddStatFrame("Peter") then it would be :PaintPeter. See the example.

  • You MAY have a method for setting up custom mouseovers and such for the lines.

This method will be called SetupFrame[frame name] like the above. See the example.

  • If you just want tooltips, create methods like Paint[frame name]Line1Tooltip.

GameTooltip anchor will be set up for you, just go ahead and write to it. This will not work if you do a custom SetupFrame. See the example for more.


:IsShowingStatFrame("frame_name")

Arguments

"frame_name"
string - name of the frame you're querying

Notes

  • Lets you know if your stat frame is being displayed


:RemoveAllStatFrames()

Notes

  • Removes all of your stat frames


:RemoveStatFrame("frame_name")

Arguments

"frame_name"
string - programmatic name of the frame to remove

Notes

  • Not necessary to call this method on disable - will automatically be called.


:RepaintAllStatFrames()

Notes

  • Repaints all of your stat frames


:RepaintStatFrame("frame_name")

Arguments

"frame_name"
string - the programmatic name of the frame

Notes

  • Orders a repaint of your stat frame


:StatBoxSet(statbox , "label" , value , percentage)

Arguments

statbox
object - the line you're drawing to
"label"
string - the label
value
string or number - the value
percentage
boolean - if the VALUE is a number show it as a percentage

Notes

  • Method you call to actually set the label and text for lines in the StatBox
  • labels and values will be coerced to strings, so don't worry too much about them
  • Will automatically show the line. Use the variant call if you don't want to do that.
  • See the example for how this is used


:StatBoxSetWithoutShow(statbox , "label" , value , percentage)

Arguments

statbox
object - the line you're drawing to
"label"
string - the label
value
string or number - the value
percentage
boolean - if the VALUE is a number show it as a percentage

Notes

  • Same call as StatBoxSet, but does not automatically show the line