keymetaphore Posted February 8, 2018 Posted February 8, 2018 Hey. I might be asking a real stupid question, but I've just ran out of ideas. I am creating a progress bar, based on DX (the one on wiki wont work because its divided in parts). I have created the first rectangle, but I have trouble calculating the width of the second one. -- ex. code -- first rectangle, base baseWidth = 200 dxDrawRectangle(10, 10, baseWidth, 10) -- might be lack of args, but you get the point -- second rect indicating progress progress = 4 dxDrawRectangle(10, 10, baseWidth/4, 10) -- this is not a correct calculation, just an example I AKA Syncer
Moderators IIYAMA Posted February 8, 2018 Moderators Posted February 8, 2018 baseWidth * (progress / 100) 4 progress / 100 = 0.04 0.04 * 200 = 8 px Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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