This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Classic Theme
Thottbot Theme
How to Alter textures in my addon's interface panel?
Post Reply
Return to board index
Post by
Taraezor
My add-on has several interface panels. I know how to make these and to fill them with some frames such as buttons, sliders, checkboxes and titles.
The problem I am having is that I want to display some spells as textures for some buttons. Every now and again the texture I use (i.e. the spell I wish to display at the time) is to be changed. So I just myFrame.spellTexture:SetTexture( myTexture).
When I display the panel I see what I want to see - lots of spells from my spellbook organised into neat rows of buttons.
But when I attempt to use a different texture, I just see the same old textures from when I created the frames/buttons.
Outside of a Interface Panel, I am able to dynamically alter the texture of a button. Over and over again. But in an Interface Panel it just doesn't happen.
There seems to be a quirk when working from within the confines of Interface panels and I just don't get it. I am an established add-on author. Not a pro, but competent.
Any help appreciated. Please do not suggest I use Ace. Thanks for any help, pleeeeease!
Post by
Myrroddin
Hide the frame or button, change the texture, then show it again. The process should be almost the same as any other frame.
If I were to guess, because I've never done what you are doing, I'd say the interface panels are normally created, then static, residing in memory or LoD until displayed. But if you specifically call Hide() and Show() on a frame, it ought to still work as you desire.
Post by
Taraezor
Yeah I suspect that what I am doing is unusual. I was chatting about exactly this with someone. The thinking is that panels are meant to be merely for "options" and these would of course be static. I am trying to do "deep" editing and perhaps I should display a frame, as I already do, independent of the Interface options system provided by Blizzard.
I thought I had already tried Hide(), edit and then Show(). I will try again.
I am aware that it is absolutely impossible to delete and then recreate frames and that things like wipe(myButtonFrame) will not really do much except create an unreachable cesspool of memory, lol. Just in case you were wondering, :)
For me, it makes sense to do what I want to do from within the Interface paradigm simply because for me it is all about how the user configures my add-on. Hence it belongs there.
Post by
Taraezor
Double checked:
myButtons:Hide()
myButtons.spellTexture:SetTexture( myTexture)
myButtons:Show()
results in nothing being displayed.
Usually when I am stuck I just go and download one add-on after another until I find one that does what I want to do. May have to resort to that again.
WoW is not exactly a new game so everything possible would already have been done by someone, for sure.
Post by
Neffi
Any help appreciated. Please do not suggest I use Ace. Thanks for any help, pleeeeease!
I need a better example of what you're doing to know what's going wrong. Post your code on
Pastebin
and give us a link.
Please do not suggest I use Ace.
Ace is framework to deal with very generic things like events and timers in a namespaced fashion. It has nothing to do with the logic of your code, so using Ace or not wouldn't make a difference here.
Hide the frame or button, change the texture, then show it again. The process should be almost the same as any other frame.
If I were to guess, because I've never done what you are doing, I'd say the interface panels are normally created, then static, residing in memory or LoD until displayed. But if you specifically call Hide() and Show() on a frame, it ought to still work as you desire.
None of that is correct. You never need to hide and reshow something for anything. And nothing is pre-loaded or pre-created whatsoever in LOD situations; once it's
loaded
, it's loaded.
Post by
Taraezor
Thx for the replies.
I have made some progress. It appears I have an error somewhere, one of those obvious ones staring me in the face. I am able to apply an overlay animation to the same buttons and then stop it playing. I can highlight and "remove" highlight. I can assign a local variable to one of the buttons and then do whatever to that local variable, include resize, hide, change texture etc.
But many thanks anyway.
Edit:
So very very dumb. Like mouse battery dead and wondering why it doesn't work. Working perfectly now. Oh yeah.... it really helps if you bother to copy one of Blizzard's button templates when you CreateFrame, as I always do. Lol. Don't know how I missed that typo.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.