View Single Post
07-21-17, 01:34 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
Something like this (adjust the slider below the Warcraft logo)?
Code:
local function SetValue(frame, texture, value)
	local val = value / 100 * 100
	local width = frame:GetWidth()
	local bar = texture
	if val == 0 then val = .01 end
	val = val / 100
	if val > 1 then val = 1 end
	texture:SetWidth(width * val)
	texture:SetTexCoord(0, val, 0, 1)
end

local f = CreateFrame("Frame", nil, UIParent)
f:SetSize(200, 100)
f:SetPoint("CENTER", UIParent)
f.t = f:CreateTexture()
f.t:SetPoint("LEFT", f)
f.t:SetSize(f:GetWidth(), f:GetHeight())
f.t:SetTexture("Interface/Glues/Common/Glues-WoW-Logo")

local s = CreateFrame("Slider", nil, UIParent)
s:SetSize(150, 34)
s:SetBackdrop( { bgFile="Interface/Buttons/UI-SliderBar-Background", edgeFile="Interface/Buttons/UI-SliderBar-Border", tile=true, EdgeSize=8, TileSize=8, insets={ left=3, right=3, top=6, bottom=6 } })
s:SetOrientation("HORIZONTAL")
s:SetPoint("TOP", f, "BOTTOM")
s:SetMinMaxValues(0, 100, 0, -10)
s:SetThumbTexture("Interface/Buttons/UI-SliderBar-Button-Horizontal")
s:SetScript("OnValueChanged", function(self) SetValue(f, f.t, self:GetValue()) end)
s:Show()
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote