Skip to content

Instantly share code, notes, and snippets.

@Meorawr
Created July 18, 2023 20:34
Show Gist options
  • Save Meorawr/878df1a37cc18326b4be2c320c61da4f to your computer and use it in GitHub Desktop.
Save Meorawr/878df1a37cc18326b4be2c320c61da4f to your computer and use it in GitHub Desktop.
Interpolated Scroll Demo
local ScrollBox = CreateFrame("Frame", nil, UIParent, "WowScrollBox")
ScrollBox:SetPoint("CENTER")
ScrollBox:SetSize(300, 300)
ScrollBox:SetInterpolateScroll(true)
local ScrollBar = CreateFrame("EventFrame", nil, UIParent, "MinimalScrollBar")
ScrollBar:SetPoint("TOPLEFT", ScrollBox, "TOPRIGHT")
ScrollBar:SetPoint("BOTTOMLEFT", ScrollBox, "BOTTOMRIGHT")
ScrollBar:SetInterpolateScroll(true)
local ScrollView = CreateScrollBoxLinearView()
ScrollView:SetPanExtent(100)
local ScrollChild = CreateFrame("Frame", nil, ScrollBox)
ScrollChild:SetSize(300, 1500)
ScrollChild.scrollable = true
local ScrollChildFill = ScrollChild:CreateTexture()
ScrollChildFill:SetAllPoints(ScrollChild)
ScrollChildFill:SetColorTexture(1, 1, 1, 1)
ScrollChildFill:SetGradient("VERTICAL", CreateColor(0, 0, 0, 1), CreateColor(1, 0, 0, 1))
ScrollUtil.InitScrollBoxWithScrollBar(ScrollBox, ScrollBar, ScrollView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment