WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Graphics Help (https://www.wowinterface.com/forums/forumdisplay.php?f=14)
-   -   How to create circular action buttons ? (https://www.wowinterface.com/forums/showthread.php?t=58407)

Kaelath 11-24-20 05:19 PM

How to create circular action buttons ?
 
2 Attachment(s)
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. :)

Seerah 11-24-20 05:24 PM

Install Masque and either use a premade circular skin or create your own using your custom textures.

SDPhantom 11-24-20 07:36 PM

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.

Kaelath 11-25-20 02:56 AM

Quote:

Originally Posted by Seerah (Post 337697)
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.

Quote:

Originally Posted by SDPhantom (Post 337700)
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");


Xrystal 11-25-20 05:05 AM

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


All times are GMT -6. The time now is 08:56 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI