Thread Tools Display Modes
11-24-20, 05:19 PM   #1
Kaelath
A Defias Bandit
Join Date: Nov 2020
Posts: 2
How to create circular action buttons ?

Hi everyone

Not having found an answer despite my Google searches, I come here to ask it here

Here is my current interface, and I would like to know how to change the current action buttons that are square by round action buttons,

I would like to apply the following appearance to them

Code:
Interface\Artifacts\Artifacts-PerkRing-Final-Mask
Except that I don't know which lua code or script is applied to do it

If someone knows how to help me, I thank him or her.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_112420_233853.jpg
Views:	748
Size:	405.5 KB
ID:	9523  
Attached Images
 
  Reply With Quote
11-24-20, 05:24 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Install Masque and either use a premade circular skin or create your own using your custom textures.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-25-20, 02:56 AM   #3
Kaelath
A Defias Bandit
Join Date: Nov 2020
Posts: 2
Originally Posted by Seerah View Post
Install Masque and either use a premade circular skin or create your own using your custom textures.
I have already tried this addon several times, but it doesn't seem to work for me, by not activating any addon except Mask.

I also preferred a lua code to introduce in my addon, which is certainly, very rudimentary.

Originally Posted by SDPhantom View Post
You would use two texture objects. For the ability icon, use SetPortraitToTexture() to convert it to a circular image. Then you put the artifact border in a separate texture over the ability image.
I'm not a lua developer
So I don't know how to correctly use the command to carry out the manipulation to realize my request

I just did a test just now but it made me a mistake lua in play, I guess
Code:
SetPortraitToTexture("ActionButton1", "Interface\Artifacts\Artifacts-PerkRing-Final-Mask");
is not a valid entry.


Code:
Message: Interface\AddOns\AddOns\Actionbar.lua:3: SetPortraitToTexture(): Couldn't find texture named 'ActionButton1'
Time: Wed Nov 25 09:47:16 2020
Count: 1
Stack: Interface\AddOns\AddOns\Actionbar.lua:3: SetPortraitToTexture(): Couldn't find texture named 'ActionButton1'
[string "=[C]"]: in function `SetPortraitToTexture'
[string "@Interface\AddOns\AddOns\Actionbar.lua"]:3: in main chunk

Locals: (*temporary) = "ActionButton1"
(*temporary) = "InterfaceArtifactsArtifacts-PerkRing-Final-Mask"

And this entry on the other hand does not cause any result in the game, the button remained square.

Code:
SetPortraitToTexture("ActionButton1NormalTexture", "Interface\Artifacts\Artifacts-PerkRing-Final-Mask");
SetPortraitToTexture("ActionButton1", "Interface\Artifacts\Artifacts-PerkRing-Final-Mask");
  Reply With Quote
11-25-20, 05:05 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
This simple block of code almost gets it working ..

It is not a button that does anything other than display an icon and border ring. You would have to add any other functionality you want, or work it into a button based off of a template. All this does is create the minimum to get the result you want.

Lua Code:
  1. local button = CreateFrame("CheckButton", "MyRoundButton", UIParent)
  2. button:SetPoint("CENTER")
  3. button:SetSize(50, 50)
  4. local texPath = GetSpellTexture(278326)
  5. local icon = button:CreateTexture("BACKGROUND")
  6. icon:SetPoint("CENTER")
  7. SetPortraitToTexture(icon,texPath)
  8. local tex = button:CreateTexture("ARTWORK")
  9. tex:SetPoint("CENTER")
  10. tex:SetTexture("Interface\\Artifacts\\Artifacts-PerkRing-Final-Mask")

You would have to create a simple addon to add this code into. It would only need a toc file and the lua file with the above code in. The below link should help you get that part started. I've heard of a site out there somewhere that creates an addon out of a block of code but I have never used it so do not know what the site is myself.

Assuming you are interesting in learning how to create at least simple addons then this may be a good starting point
https://wow.gamepedia.com/Getting_st...writing_addons
__________________

Last edited by Xrystal : 11-25-20 at 05:11 AM.
  Reply With Quote
11-24-20, 07:36 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
You would use two texture objects. For the ability icon, use SetPortraitToTexture() to convert it to a circular image. Then you put the artifact border in a separate texture over the ability image.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-24-20 at 07:41 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Graphics Help » How to create circular action buttons ?

Thread Tools
Display Modes

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