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...)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{client function}}
{{client function}}
This function is used to set the progress of a progressbar.
This function is used to set the progress of a progressbar as a percentage.


==Syntax==
==Syntax==
Line 10: Line 10:
*'''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 33:
==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}
{{GUI_events}}

Revision as of 14:15, 20 May 2018

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