View Single Post
11-29-10, 02:35 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Circular Masks for Textures

Holy Cow.

I finally had enough time to do a testrun on this:


The bottom textures are rotating all the time btw.

So rotatiing masked circular textures are actually possible.

Currently tricking out the values. Will post he code when done.

So here is the first result with a texture of my own:


My texture is 128x128px. I think what the distortion tells me is that I need to make the basic texture go 64x64px. Gonna try that now. Texture has to be in BLP file format to work btw.

*edit*

Got it.



What you see here is the first circular masked rotating texture in WoW.

All textures are the same. Just two of them are masked and two of them use the animation system.

But...this is nothing more but an alpha layer with some very strict rules. So you will not profit from it that much unless you want to use it on tons of textures that have no circular alpha layer.

If that kind of mask could be applied to models...well that would be another story.

Code:
  
  -- Zorks round texture animation testmod

  local function createme(h,tex,circle,x,y,size,dur,degree)    
        
    local t = h:CreateTexture(nil,"BACKGROUND",nil,-8)
    t:SetPoint("CENTER",x,y)
    t:SetSize(size,size)
    --t:SetBlendMode("ADD")
    
    if circle then
      SetPortraitToTexture(t, "Interface\\AddOns\\rGalaxy\\"..tex)
    else
      t:SetTexture("Interface\\AddOns\\rGalaxy\\"..tex)
    end
    
    if dur then
    
      local ag = t:CreateAnimationGroup()    
      local anim = ag:CreateAnimation("Rotation")
      anim:SetDegrees(degree)
      anim:SetDuration(dur)    
      ag:Play()
      ag:SetLooping("REPEAT")
    
    end
    
    return t    
  
  end  
  
  local h = CreateFrame("Frame",nil,UIParent)  
  h:SetPoint("CENTER",0,0)
  h:SetSize(64,64)
  
  local a = createme(h,"bob",true,70,70,128)
  local b = createme(h,"bob",false,-70,70,128)
  local c = createme(h,"bob",true,70,-70,128,15,360)
  local d = createme(h,"bob",false,-70,-70,128,15,360)
  local e = createme(h,"bob",true,70,-140,128,15,-360)
  local f = createme(h,"bob",false,-70,-140,128,15,-360)
bob is a BLP file with no alpha layer and 64x64 px in size.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 11-30-10 at 08:03 AM.
  Reply With Quote