Otto Posted February 20, 2015 Share Posted February 20, 2015 Que tal, he creado mi primera función a base de algunos de mis conocimientos, aquí la comparto con la comunidad: local unlerp = function(from,to,lerp) return (lerp-from)/(to-from) end function dxDrawProgressBar( startX, startY, width, height, progress, color, backColor ) local progress = math.max( 0, (math.min( 100, progress) ) ) local wBar = width*.18 for i = 0, 4 do --back local startPos = (wBar*i + (width*.025)*i) + startX dxDrawRectangle( startPos, startY, wBar, height, backColor ) --progress local eInterval = (i*20) local localProgress = math.min( 1, unlerp( eInterval, eInterval + 20, progress ) ) if localProgress > 0 then dxDrawRectangle( startPos, startY, wBar*localProgress, height, color ) end end end Link de la función en la wiki 1 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