Garry's Mod Wiki

DProgress

Description

A progressbar, works with a fraction between 0 and 1 where 0 is 0% and 1 is 100%.

View source

Parent

Derives methods, etc not listed on this page from Panel.

Methods

number DProgress:GetFraction()
Returns the progress bar's fraction. 0 is 0% and 1 is 100%.
DProgress:SetFraction( number fraction )
Sets the fraction of the progress bar. 0 is 0% and 1 is 100%.

Example

Creates a DProgress set to 75% (0.75 out of 1)

local DProgress = vgui.Create( "DProgress" ) DProgress:SetPos( 10, 30 ) DProgress:SetSize( 200, 20 ) DProgress:SetFraction( 0.75 )
Output: