Sets a Texture object to display an arbitrary texture, altering it to fit a circular frame. Used in the default UI to display square textures (such as item icons) within the circular "portrait" frames used in many default UI elements.
Caveat: The texture must be of the BLP format.
See also Utility functions.
Signature:
SetPortraitToTexture("frameName",
"texturePath")
Arguments:
frameName
- Name of a Texture object (string
)texturePath
- Path to a texture to display (string
)
Examples:
-- Change the player portrait to be the same as the keychain portrait SetPortraitToTexture("PlayerPortrait", "Interface\\ContainerFrame\\KeyRing-Bag-Icon") -- Set the player portrait to be the icon for "Staff of Infinite Mysteries" SetPortraitToTexture("PlayerPortrait", "Interface\\Icons\\INV_Weapon_Halberd17")