keymetaphore Posted February 8, 2018 Share 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 Link to comment
Moderators IIYAMA Posted February 8, 2018 Moderators Share Posted February 8, 2018 baseWidth * (progress / 100) 4 progress / 100 = 0.04 0.04 * 200 = 8 px 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