Msypon Posted February 24, 2013 Share 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? Link to comment
X-SHADOW Posted February 24, 2013 Share 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 ) Link to comment
xXMADEXx Posted February 25, 2013 Share Posted February 25, 2013 Read this: https://wiki.multitheftauto.com/wiki/Gui ... rogressBar Link to comment
Castillo Posted February 25, 2013 Share 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. Link to comment
Msypon Posted February 25, 2013 Author Share Posted February 25, 2013 but with setTimer? Link to comment
Castillo Posted February 25, 2013 Share Posted February 25, 2013 You can either use a timer to change a variable which will be later used for width at dxDrawRectangle. Link to comment
codeluaeveryday Posted February 27, 2013 Share 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 Link to comment
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