#How to Duplicate (Clone) a Region?

7 messages · Page 1 of 1 (latest)

barren orbit
#

Hello! I'm trying to attach a icon to a given spell, but i'm only able to anchor to one button, is it possible to clone/duplicate a region? Haven't found anything, neither figured out how cloning works with the code on github.

So far, my code looks like this.


local anchor = function() 
    
    
    
    local spellName = aura_env.region.states[1].trigger.spellName    
    local actionButtons = aura_env.getButtons(spellName)
    
    print(aura_env.regions)
    
    for _,button in pairs(actionButtons) do
        
        
        -- HERE I'd like "clone/duplicate" the region and add one for each actionbar button that the spell is found
        
        
        aura_env.region:SetHeight(button:GetHeight())
        aura_env.region:SetWidth(button:GetWidth())   
        aura_env.region:SetPoint("CENTER", button, "CENTER", 0, 0)
        
    end
   
end

Any tips on how to duplicate the aura_env.region?

edgy trellis
#

That's not how you should use WeakAuras. You are working against the addon.

barren orbit
#

Any tips on the proper way that i attach a text over a actionbar button?

vestal cypress
#

is it possible to clone/duplicate a region?
no

lethal plank
#

its work for a trigger

barren orbit
# lethal plank its work for a trigger

I've read the TSU documentation, in theory it should work, but the only example is attaching on a UNIT (nameplate) how i am supposed to clone and attach on a Blizzard Frame, like a ActionBarButton?

I also could manually set the point, but how could i recover the Region? I tried the WeakAuras.GetRegion(aura_env.id, aura_env.cloneId) but had no success on getting the cloneId...

lethal plank
#

custom anchor