WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   glow border + spark (https://www.wowinterface.com/forums/showthread.php?t=56166)

GreyFox777 04-20-18 02:04 PM

glow border + spark
 
Can someone help me to add an glowing border and spark texture please?

Quote:

-- Castbar generator
function core:CreateCastbar(self)
local castbar = CreateFrame("StatusBar", "oUF_LumenCastBar", self)
castbar:SetStatusBarTexture(m.textures.status_texture)
castbar:GetStatusBarTexture():SetHorizTile(false)
castbar:SetFrameStrata("HIGH")
castbar:SetToplevel(true)

castbar.bg = castbar:CreateTexture(nil, 'BORDER')
castbar.bg:SetAllPoints()
castbar.bg:SetAlpha(0.3)
castbar.bg:SetTexture(m.textures.bg_texture)
castbar.bg:SetColorTexture(1/3, 1/3, 1/3)

castbar.Text = castbar:CreateFontString(nil, "OVERLAY")
castbar.Text:SetTextColor(1, 1, 1)
castbar.Text:SetShadowOffset(1, -1)
castbar.Text:SetJustifyH("LEFT")
castbar.Text:SetHeight(12)

castbar.Time = castbar:CreateFontString(nil, "OVERLAY")
castbar.Time:SetTextColor(1, 1, 1)
castbar.Time:SetJustifyH("RIGHT")

castbar.Icon = castbar:CreateTexture(nil, 'ARTWORK')
castbar.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)

neverg 04-22-18 05:37 PM

You can check my code here to see how to do it: https://github.com/greven/oUF_lumen/.../core.lua#L120

Lua Code:
  1. -- Create Glow Border
  2. function core:setglowBorder(self)
  3.   self.Glowborder = CreateFrame("Frame", nil, self)
  4.   self.Glowborder:SetFrameLevel(0)
  5.   self.Glowborder:SetPoint("TOPLEFT", self, "TOPLEFT", -6, 6)
  6.   self.Glowborder:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 6, -6)
  7.   self.Glowborder:SetBackdrop({bgFile = m.textures.white_square, edgeFile =  m.textures.glow_texture,
  8.     tile = false, tileSize = 16, edgeSize = 4, insets = {left = -4, right = -4, top = -4, bottom = -4}})
  9.   self.Glowborder:SetBackdropColor(0, 0, 0, 0)
  10.   self.Glowborder:SetBackdropBorderColor(0, 0, 0, 1)
  11. end

And my Castbar module: https://github.com/greven/oUF_lumen/...ts/castbar.lua

This code might need some clean up but the principle still applies.

Kkthnx 04-22-18 05:38 PM

As well you can use anything from here as well. Any questions just ask.

https://github.com/Kkthnx-WoW/Kkthnx...s/Castbars.lua


All times are GMT -6. The time now is 11:27 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI