Garry's Mod Wiki

Panel:ResetAllFades

Panel:ResetAllFades( boolean hold, boolean expiredOnly, number newSustain )

Description

Resets all text fades in a RichText element made with Panel:InsertFade.

Arguments

1 boolean hold
True to reset fades, false otherwise.
2 boolean expiredOnly
Any value equating to true will reset fades only on text segments that are completely faded out.
3 number newSustain
The new sustain value of each faded text segment. Set to -1 to keep the old sustain value.

Example

Creates a RichText panel where two text segments slowly fade out and get reset to full alpha 5 seconds after being created.

-- Window frame TextFrame = vgui.Create("DFrame") TextFrame:SetSize(200, 100) TextFrame:Center() TextFrame:SetTitle("ResetAllFades") TextFrame:MakePopup() -- Rich Text panel local richtext = vgui.Create("RichText", TextFrame) richtext:Dock(FILL) -- Append text and start fading a few frames after creation (won't work otherwise) timer.Simple(0.05, function() richtext:SetBGColor(Color(32, 32, 32)) richtext:SetFontInternal("GModNotify") richtext:AppendText("This is ") richtext:InsertFade(5, 2) richtext:AppendText("a test...") richtext:InsertFade(5, 1) end) -- 5 seconds after creation, reset all the fades timer.Simple(5, function() richtext:ResetAllFades(true, false, -1) end)
Output:

Page Links


Special Pages


Wikis

?

Render Time: 39ms

DB GetPage 4
Generate Html 12
SaveChanges (1) 8
Render Body 0
Render Sidebar 12