Help with button textures
Hi all
I have an issue with the textures on a button. Both the highlight and pushed textures fit the button frame without issue, but the normal texture always displays much bigger than the other two thus exceeding the button size. This is an image of what I am seeing. http://i.imgur.com/xLcC1uS.png?1 Here is my code. Code:
local myTestingFrame = CreateFrame("Button","myTestingFrame",UIParent, "SecureActionButtonTemplate,ActionButtonTemplate") |
ActionButtonTemplate sets some anchors for the normal textures. You could try undoing them, but I'm not sure that it will be enough:
Code:
myTestingFrame:GetNormalTexture():ClearAllPoints() |
The size won't reset unless you re-define the points. You could just do myTestingFrame:GetNormalTexture():SetAllPoints(myTestingFrame). Furthermore, you're inheriting templates, yet not using any of their assets. SecureActionButtonTemplate allows you to define attributes on the frame to direct its own OnClick handler to perform protected actions. Replacing this with your own code completely nullifies this. ActionButtonTemplate adds many additional frames, textures, and fontstrings to the button that aren't in use and are taking up resources just sitting there, doing nothing.
Simply removing ActionButtonTemplate from the inheritance list will fix your normal texture problem anyway. You will need to set the button size yourself. |
Hi SDPhantom & Lombra
Thank you both for your help. I ended up removing the "SecureActionButtonTemplate,ActionButtonTemplate" and now everything is working properly. Cheers |
All times are GMT -6. The time now is 11:26 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI