This library is designed for addon authors who wish to generate consistent screenshots for their image gallery.
- Requires LibStub
Just install this as a standalone addon from CurseForge or Wago. You don't need to embedded or package it into you project. (A dependency link as a used tool is appreciated though. :) )
local gg = LibStub("GalleryGenerator")
gg:TakeScreenshots(
{
function(api)
api:BackScreen() -- hide game world with black screen
ToggleCharacter("PaperDollFrame") -- shows character frame
api:PointAndClick(PaperDollFrame.ExpandButton)
end,
function(api)
api:BackScreen(0, 1, 0) -- green screen
api:Click(PaperDollFrame.ExpandButton) -- revert previous toggle
api:PointAndClick(CharacterFrameTab2)
end,
},
function(api)
api:Click(CharacterFrameTab1)
ToggleCharacter("PaperDollFrame")
end
)
More practical examples can be found here:
The library itself has only one external method called TakeScreenshots
.
- The first argument is a list of your preparation functions. A screenshot is triggered 1 Second after the end of each function.
- With a further optional function as second argument, you can revert your UI back into the initial state.
Each function is provided with an internal API as first argument.
This places a virtual pointer icon central on the given frame. It also triggers script handlers for OnEnter and all parent frames. Subsequently, it also triggers OnLeave.
targetFrame table|Frame
A frame to place the pointer ontooffsetX nil|number
Optional offset right of the center (negative for left)offsetY nil|number
Optional offset up of the center (negative for down)
Returns:
table|TextureBase
Texture instance of pointer icon for own further customization
This triggers all cLick handlers on the given frame. (In
order: OnMouseDown
, OnMouseUp
, PreClick
, OnClick
, PostClick
)
targetFrame table|Frame
Frame to trigger a click onbutton nil|string
Optional mouse button identifier. Defaults to "LeftButton"
A simple function to subsequently call Point()
and Click()
targetFrame table|Frame
Frame to place the pointer on and trigger a LeftClick
Returns:
table|TextureBase
Texture instance of pointer icon for own further customization
This interrupts the internal Screenshot timer, so you can wait longer for your UI to finish loading.
You HAVE TO call Continue()
on your own to process further!
This continues processing after a Wait()
interruption.
This shows a back screen to hide the game world.
red nil|number
Optional red component [0.0 - 1.0]green nil|number
Optional green component [0.0 - 1.0]blue nil|number
Optional blue component [0.0 - 1.0]
- You should use the english game client to take screenshots. So they are readable by probably the most users. (You can use a PTR client for that. ;))
- Use the
:BackScreen()
to hide the game world and to provide a nice background color for further processing. - You can add your script and images into your project repository, but you should ignore them in your .pkgmeta file. So it doesn't bloat the final zip unnecessarily.
- After you have taken some nice shots. You can automate copying and cropping the files a bit as well. Read further in the project wiki.