Created
July 18, 2023 20:34
-
-
Save Meorawr/878df1a37cc18326b4be2c320c61da4f to your computer and use it in GitHub Desktop.
Interpolated Scroll Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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