Skip to content

Get Class Coords

UI Utility

Returns class icon atlas coordinates with optional cropping.

NamespaceEModuleCoreLifecyclestable
E:GetClassCoords(classFile, crop, get)

Returns class icon atlas coordinates with optional cropping.

  • classFile: Class token used by CLASS_ICON_TCOORDS.
  • crop: Boolean or numeric crop amount.
  • get: Boolean; returns the raw coordinate table when true.

left, right, top, bottom texture coordinates, or raw table when get is true.

local l, r, t, b = E:GetClassCoords("DRUID", true)
icon:SetTexCoord(l, r, t, b)

Handy for addon class icons that should use ElvUI’s crop conventions.

Source: ElvUI/Game/Shared/General/API.lua:1253