WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   CheckButton: PushedTexture not overlaying but replacing NormalTexture? (https://www.wowinterface.com/forums/showthread.php?t=57901)

LudiusMaximus 04-01-20 05:29 AM

CheckButton: PushedTexture not overlaying but replacing NormalTexture?
 
I want to emulate an action bar button:

Code:

local myButton = CreateFrame("CheckButton", nil, UIparent)
myButton:SetPoint("CENTER")
myButton:SetSize(50, 50)
myButton:SetNormalTexture(132224)
myButton:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square")
myButton:SetPushedTexture("Interface\\Buttons\\UI-Quickslot-Depress")
myButton:SetCheckedTexture("Interface\\Buttons\\CheckButtonHilight")

It works fine, except that while the button is pushed down, the UI-Quickslot-Depress texture is shown exclusively instead of overlaying the normal texture, like it is the case for the highlight and checked textures.

What am I missing?

LudiusMaximus 04-01-20 07:52 AM

Hm, maybe the NormalTexture is not meant to be used like this for action bar buttons.
I found this work around:

Code:

local myButton = CreateFrame("CheckButton", nil, UIparent)
myButton:SetPoint("CENTER")
myButton:SetSize(50, 50)
myButton.normalTexture = myButton:CreateTexture()
myButton.normalTexture:SetAllPoints()
myButton.normalTexture:SetDrawLayer("BACKGROUND", 0)
myButton.normalTexture:SetTexture(132224)
myButton:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square")
myButton:SetPushedTexture("Interface\\Buttons\\UI-Quickslot-Depress")
myButton:SetCheckedTexture("Interface\\Buttons\\CheckButtonHilight")


Fizzlemizz 04-01-20 12:00 PM

When you press a physical button it usually effects the appearance of it's location (a keyboard button "looks" lower and slightly offset from normal). Using separate textures allows you to create the widest range of looks for a button.


All times are GMT -6. The time now is 04:03 AM.

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