Quantcast CheckButton: PushedTexture not overlaying but replacing NormalTexture? - WoWInterface
Thread Tools Display Modes
04-01-20, 05:29 AM   #1
LudiusMaximus
A Chromatic Dragonspawn
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 160
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?
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote
04-01-20, 07:52 AM   #2
LudiusMaximus
A Chromatic Dragonspawn
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 160
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")
__________________
~ Be the change you want to see in the world... of warcraft interface! ~

Last edited by LudiusMaximus : 04-02-20 at 03:10 AM.
  Reply With Quote
04-01-20, 12:00 PM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,203
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 04-01-20 at 12:03 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » CheckButton: PushedTexture not overlaying but replacing NormalTexture?

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