1. #1

    [WoW Add-on] LUA flash texture example?

    All fixed, disregard.
    Last edited by Kujako; 2013-01-16 at 08:22 PM.
    It is by caffeine alone I set my mind in motion. It is by the beans of Java that thoughts acquire speed, the hands acquire shakes, the shakes become a warning.

    -Kujako-

  2. #2
    Moderator llDemonll's Avatar
    Join Date
    Apr 2008
    Location
    Washington
    Posts
    6,583
    why do people delete things like this?

    leave your problem up and post the answer. it's frustrating when you search google for an issue and come across a thread like this

    "I'm glad you play better than you read/post on forums." -Ninety
    BF3 Profile | Steam Profile | Assemble a Computer in 9.75 Steps! | Video Rendering Done Right

  3. #3
    Quote Originally Posted by llDemonll View Post
    why do people delete things like this?

    leave your problem up and post the answer. it's frustrating when you search google for an issue and come across a thread like this
    Thought I had, edit messed up a bit. At any rate, here's the solution such as it is.

    Textured frame,
    Code:
    -- Rage flash frame
    local f = CreateFrame("Frame","rageFrame",WorldFrame);
    f:SetFrameStrata("BACKGROUND");
    f:SetClampedToScreen(true)
    f:SetAllPoints(UIParent)
    local t = f:CreateTexture(nil,"BACKGROUND");
    t:SetTexture("Interface\\AddOns\\TankScripts\\Textures\\rage.tga");
    t:SetAlpha(0.5);
    t:SetBlendMode("ADD");
    t:SetVertexColor(1, 0.1, 0.1);
    t:SetAllPoints(frame);
    f.texture = t;
    f:SetPoint("CENTER",0,0);
    f:Hide();
    Then trap the UNIT_POWER event to start the flashing when over 60 rage and stop it when under or not a rage user.
    Code:
        if (event=="UNIT_POWER") then
            if(UnitPowerType("player")==1 and TS_SAVAGE=="on") then
                if(UnitPower("player")>=60) then
                    if (UIFrameIsFlashing(f)) then
                    --    f.fadeInTime = 0.4;
                    --    f.fadeOutTime = 0.6;
                    --    f.flashInHoldTime = 1;
                    else
                        UIFrameFlash(f, 0.5, 0.5, -1);
                    end
                else
                    if (UIFrameIsFlashing(f)) then
                        UIFrameFlashStop(f);
                    end
                end
            else
                if (UIFrameIsFlashing(f)) then
                    UIFrameFlashStop(f);
                end
            end
        end
    The upshot of that is a flashing full screen transparent texture when I'm over 60 rage. The intent in this case was to alert me when I was ready to use Savage Defense.
    It is by caffeine alone I set my mind in motion. It is by the beans of Java that thoughts acquire speed, the hands acquire shakes, the shakes become a warning.

    -Kujako-

  4. #4
    Here is a post of the full set of code...

    http://www.mmo-champion.com/threads/...defense-add-on!
    It is by caffeine alone I set my mind in motion. It is by the beans of Java that thoughts acquire speed, the hands acquire shakes, the shakes become a warning.

    -Kujako-

  5. #5
    Moderator llDemonll's Avatar
    Join Date
    Apr 2008
    Location
    Washington
    Posts
    6,583
    :thumbsup: thanks for reposting and answering

    "I'm glad you play better than you read/post on forums." -Ninety
    BF3 Profile | Steam Profile | Assemble a Computer in 9.75 Steps! | Video Rendering Done Right

  6. #6
    Quote Originally Posted by llDemonll View Post
    :thumbsup: thanks for reposting and answering
    Sure thing, hope its of use to someone. I find the resulting add-on very nifty for Druid tanking. Granted there are a ton of configurable aura add-ons out there, but I like to keep things simple and lightweight.
    It is by caffeine alone I set my mind in motion. It is by the beans of Java that thoughts acquire speed, the hands acquire shakes, the shakes become a warning.

    -Kujako-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •