Msypon Posted February 24, 2013 Posted February 24, 2013 how to make a dxDrawRectancle load? for example i have a custom progress bar with dxDrawRectangle, but i doesnt know how to make load like guiProgressBarSetProgress, can anyone help me?
X-SHADOW Posted February 24, 2013 Posted February 24, 2013 Example : bar = guiCreateProgressBar ( 50, 50, 100, 70, false ) setTimer ( function ( ) guiProgressBarSetProgress ( bar, 20 ) outputChatBox ( 'Progress Bar = ' .. guiProgressBarGetProgress ( bar ) ) end, 1000, 1 )
xXMADEXx Posted February 25, 2013 Posted February 25, 2013 Read this: https://wiki.multitheftauto.com/wiki/Gui ... rogressBar
Castillo Posted February 25, 2013 Posted February 25, 2013 @SHADOW, @MADE: He's not talking about GUI, he's talking about DX rectangles. @Msypon: You must change the width as pNine said.
Castillo Posted February 25, 2013 Posted February 25, 2013 You can either use a timer to change a variable which will be later used for width at dxDrawRectangle.
codeluaeveryday Posted February 27, 2013 Posted February 27, 2013 It was a bit annoying to not know what purpose you need it for, but this is the best example I could create for you, it actually could've been better, but you get the point. sX, sY = guiGetScreenSize() addEventHandler('onClientRender', getRootElement(), function() dxDrawRectangle(sX, sY, 200, 50, tocolor(30, 30, 30, 200), false) dxDrawRectangle(sX, sY, dxProgressBarGetProgress()*2, 50, tocolor(255, 0, 0, 200), false) end ) function dxProgressBarSetProgress(new) progress = new end function dxProgressBarGetProgress() return progress end
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now