Jump to content

Circle dxDrawImageSection


FileEX

Recommended Posts

Hi i want make circle progress bar with dxDrawImageSection and i do it, but i have weird bug and i don't know how can i fix it.

My progress bar with 1%

https://imgur.com/o7uCKPX

My progress bar with 59%

https://imgur.com/JAhOUdA

I know about width is wrong, but i don't know how can i fix it :/

 

My code

local a = 59;

addEventHandler('onClientRender', root, function()
	if (a <= 60) then
		local div = a / 60;
	
		dxDrawImageSection(rend['rpm'][1], rend['rpm'][2], rend['rpm'][3] * div, rend['rpm'][3]*0.6, 0, 0, 268 * div, 268*0.6, tex[9], 0,0,0, 0xFFFFFFFF);
	else
		dxDrawImageSection(rend['rpm'][1], rend['rpm'][2], rend['rpm'][3], rend['rpm'][3] * (a / 100), 0, 0, 268, 268 * (a / 100), tex[9], 0,0,0, 0xFFFFFFFF);
	end
end);

addCommandHandler('setpr', function(cmd,b)
	a = tonumber(b);
end);

 

Edited by FileEX
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...