DgsProgressBarSetMode: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:


===Returns===
===Returns===
Returns [[element]] of the progress bar if it was created succesfully, ''false'' otherwise.
Returns ''true'' if succeed, ''false'' otherwise.


<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
DGS = exports.dgs
DGS = exports.dgs
progressbar = DGS:dgsCreateProgressBar(286, 307, 317, 43, false)  
local tex = dxCreateTexture("exampleImage.png")
number = 0
pb1 = DGS:dgsCreateProgressBar(100,300,400,50,false)
setTimer(function ()
DGS:dgsSetProperties(pb1,{barimg=tex,barcolor=tocolor(255,255,255,255)})
number = number + 1
pb2 = DGS:dgsCreateProgressBar(100,370,400,50,false)
DGS:dgsProgressBarSetProgress(progressbar,number)
DGS:dgsSetProperties(pb2,{barimg=tex,barcolor=tocolor(255,255,255,255)})
if number == 100 then
DGS:dgsProgressBarSetMode(pb2,true)
number = 0
addEventHandler("onClientRender",root,function()
end  
local tick = getTickCount()/20%360/180*math.pi
end,3000,0)
local pos = (math.cos(tick)*100+100)/2
DGS:dgsProgressBarSetProgress(pb1,pos)
DGS:dgsProgressBarSetProgress(pb2,pos)
end)
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{DGSFUNCTIONS}}
{{DGSFUNCTIONS}}

Latest revision as of 07:28, 11 February 2018

This function sets bar image showing mode.

Syntax

bool dgsProgressBarSetMode ( element progressBar, bool mode )
The Effect Of Mode.

Required Arguments

  • progressBar: the Progress Bar that you want to operate.
  • mode: the mode to choose ( see effect in the the right side image ).

Returns

Returns true if succeed, false otherwise.

DGS = exports.dgs
local tex = dxCreateTexture("exampleImage.png")
pb1 = DGS:dgsCreateProgressBar(100,300,400,50,false)
DGS:dgsSetProperties(pb1,{barimg=tex,barcolor=tocolor(255,255,255,255)})
pb2 = DGS:dgsCreateProgressBar(100,370,400,50,false)
DGS:dgsSetProperties(pb2,{barimg=tex,barcolor=tocolor(255,255,255,255)})
DGS:dgsProgressBarSetMode(pb2,true)
addEventHandler("onClientRender",root,function()
	local tick = getTickCount()/20%360/180*math.pi
	local pos = (math.cos(tick)*100+100)/2
	DGS:dgsProgressBarSetProgress(pb1,pos)
	DGS:dgsProgressBarSetProgress(pb2,pos)
end)

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips