Thread Tools Display Modes
10-03-15, 01:22 PM   #1
chanceboon
A Murloc Raider
Join Date: Oct 2015
Posts: 5
Button Textures

Ok, I decided to get my feet wet at trying to make an addon. I created a simple panel with a pair of buttons that, when pressed, generate a number between 1 and 100 and set it to a print command.

My question is, instead of the UIPanelButtonTemplate to create the boring little buttons, how does one go about putting a textured button there instead. I don't want to create my own graphics, I just want to use a pre-existing one...let's say the icon for the lightning bolt spell...if someone could throw out a simple snippet or point me in a direction, I'd be grateful.

Thanks in advance.
  Reply With Quote
10-03-15, 01:41 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Lua Code:
  1. local button = CreateFrame('button', nil, UIParent)
  2. button:SetSize(64, 64)
  3. button:SetPoint('CENTER')
  4. button:SetNormalTexture('interface/icons/inv_mushroom_11')
  Reply With Quote
10-03-15, 05:02 PM   #3
chanceboon
A Murloc Raider
Join Date: Oct 2015
Posts: 5
Excellent!

You all make it look so simple. Thanks!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Button Textures


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off