Stop hardcoding texture coordinates. Start using atlases like it's 2026.
Features โข Installation โข Usage โข API โข Contributing
Ever written code like this?
texture:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes")
texture:SetTexCoord(0, 0.25, 0, 0.25) -- warrior... I think? ๐คท
texture:SetSize(64, 64)Yeah, we've all been there. It's 2026 and we're still manually calculating texture coordinates like it's 2004.
SetAtlas(texture, "class-warrior", true)That's it. One line. Clean, readable, maintainable.
SetAtlas(texture, "class-mage", true)Works in FrameXML and GlueXML
- Download the latest release
- Copy
AtlasHelper.luaandAtlasInfo.luatoInterface/FrameXML/ - Add to your
FrameXML.toc,AtlasHelper.luaandAtlasInfo.lua - Reload UI (
/reload)
World of Warcraft/
โโโ Data/
โโโ Patch-{4-9/a-z}.MPQ/
โโโ Interface/
โโโ FrameXML/
โ โโโ FrameXML.toc โ Add atlas files here
โ โโโ AtlasHelper.lua โ Copy this
โ โโโ AtlasInfo.lua โ Copy this
โโโ GlueXML/
โโโ GlueXML. toc โ (Optional) For login screen
โโโ AtlasHelper.lua โ Copy if using Glue
โโโ AtlasInfo.lua โ Copy if using Glue
local frame = CreateFrame("Frame", nil, UIParent)
frame:SetSize(128, 128)
frame:SetPoint("CENTER")
local texture = frame:CreateTexture(nil, "ARTWORK")
texture:SetAllPoints()
-- โจ Magic happens here
SetAtlas(texture, "groupfinder-icon-class-warrior", true)
frame:Show()<Frame name="MyFrame" parent="UIParent">
<Size x="400" y="300"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture name="$parentIcon" parentKey="Icon">
<Size x="64" y="64"/>
<Anchors>
<Anchor point="CENTER"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<!-- ๐ฅ New way -->
<OnLoad>
SetAtlas(self.Icon, "class-warrior", true)
</OnLoad>
</Scripts>
</Frame>The file="atlas:name" attribute syntax does NOT work in XML files due to WoW's XML parser creating textures before Lua hooks are installed.
Always use SetAtlas() in OnLoad scripts for XML-defined textures.
Loads atlas coordinate data.
atlasTable(table) - Atlas data structure
- (number) - Number of atlases loaded
local myAtlases = {
["Interface/MyAddon/Icons"]={
["my-icon"]={64, 64, 0, 1, 0, 1, false, false, "1x"},
},
}
C_Texture.LoadAtlasData(myAtlases) -- Returns: 1Gets atlas metadata.
name(string) - Atlas name (case-insensitive)
- (table|nil) - Atlas info or nil if not found
local info = C_Texture.GetAtlasInfo("class-mage")
--[[
{
width = 256,
height = 256,
left = 0. 25,
right = 0.5,
top = 0,
bottom = 0.25,
file = "Interface/Glues/CharacterCreate/UI-CharacterCreate-Classes"
}
]]Applies atlas to a texture.
texture(Texture) - Texture objectname(string) - Atlas nameuseSize(boolean) - Auto-resize to atlas dimensions
- (boolean) - Success status
SetAtlas(myTexture, "class-warrior", true) -- Returns: trueAtlas definitions follow Retail's format:
["path/to/texture/file"]={
["atlas-name"]={width, height, left, right, top, bottom, tilesH, tilesV, scale},
}| Index | Name | Type | Description |
|---|---|---|---|
| 1 | width | number | Atlas width in pixels |
| 2 | height | number | Atlas height in pixels |
| 3 | left | number | Left UV coordinate (0-1) |
| 4 | right | number | Right UV coordinate (0-1) |
| 5 | top | number | Top UV coordinate (0-1) |
| 6 | bottom | number | Bottom UV coordinate (0-1) |
| 7 | tilesH | boolean | Tiles horizontally |
| 8 | tilesV | boolean | Tiles vertically |
| 9 | scale | string | Texture scale ("1x", "2x") |
["Interface/Glues/CharacterCreate/UI-CharacterCreate-Classes"]={
["class-warrior"]={256, 256, 0, 0.25, 0, 0.25, false, false, "1x"},
["class-mage"]={256, 256, 0.25, 0.5, 0, 0.25, false, false, "1x"},
}We love contributions!
Open an issue (yes, again)
- Fork the repo
- Create a feature branch
(git checkout -b feature/amazing-feature) - Commit your changes
(git commit -m 'Add amazing feature') - Push to the branch
(git push origin feature/amazing-feature) - Open a Pull Request
All original code is licensed under AGPL-3.0.
Atlas coordinate data is extracted from WoW and remains property of Blizzard Entertainment.
Source: Townlong Yak
| Who | What |
|---|---|
| ๐ฎ Blizzard Entertainment | Original atlas system & data |
| ๐ Townlong Yak | FrameXML extraction & docs |
| ๐จโ๐ป iThorgrim | WotLK port & implementation |
This project is not affiliated with, endorsed by, or supported by Blizzard Entertainment. World of Warcraftยฎ and Blizzard Entertainmentยฎ are registered trademarks of Blizzard Entertainment, Inc.
Use at your own risk. This is a community project for educational purposes.
๐ Made with love for the WotLK community
*If this project helped you, consider giving it a โญ! *