GuiProgressBarSetProgress: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: {{client function}} This function is used to set the progress of a progressbar. ==Syntax== <syntaxhighlight lang="lua"> bool guiProgressBarSetProgress ( progressBar theProgressbar, float progress ) </co...)
 
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{client function}}
__NOTOC__
This function is used to set the progress of a progressbar.
{{Client function}}
This function is used to set the progress of a progressbar as a percentage.


==Syntax==
==Syntax==
Line 10: Line 11:
*'''theProgressbar''': The progressbar you want to change the progress of
*'''theProgressbar''': The progressbar you want to change the progress of
*'''progress''': a float ranging from 0 - 100
*'''progress''': a float ranging from 0 - 100


===Returns===
===Returns===
Returns true if the progress was set, false otherwise.
Returns true if the progress was set, false otherwise.


==Example==
==Example==
Line 35: Line 34:
==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}
{{GUI_events}}

Latest revision as of 07:58, 5 August 2021

This function is used to set the progress of a progressbar as a percentage.

Syntax

bool guiProgressBarSetProgress ( progressBar theProgressbar, float progress )

Required Arguments

  • theProgressbar: The progressbar you want to change the progress of
  • progress: a float ranging from 0 - 100

Returns

Returns true if the progress was set, false otherwise.

Example

This example sets the progress of a bar called "somebar" created with guiCreateProgressBar, and outputs it to the chatbox.

-- If the progressbar exsist then
if ( somebar ) then
	-- set the progress
        guiProgressBarSetProgress(somebar, 80)
        -- get the progress
	progress = guiProgressBarGetProgress(somebar)
	-- output to the chatbox
	outputChatBox ( "Current progress:" .. progress .. "%" )
else --if the progressbar was not found
       outputChatBox ("progressbar not found!")
       -- output a message
end

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI