slaver0110
Member
- Joined
- Mar 21, 2011
- Messages
- 72
- Reaction score
- 2
- Points
- 6
I'm trying to implement a simple horizontal-bar display of propellant resources in an MFD.
It goes like: (just as an example)
Propellant Resource: PR
Bar-Width at full propellant: 350 pixels from left
Bar-Width at zero propellant: zero pixels from left
The filled bar is simply a visual representation of how much of a given propellant resource remains; much like in the RefuelMFD, and others like it.
Obviously, if PR is greater than 350, the bar will appear off-scale, so I need to mathematically scale the bar to fit within a certain range.
I realize that the answer/formula for this is most likely rediculously simple, but after an hour of trying on my own (I can be stubborn that way) I can't figure it out.
I ask the community for a little help again.:shrug:
It goes like: (just as an example)
Propellant Resource: PR
Bar-Width at full propellant: 350 pixels from left
Bar-Width at zero propellant: zero pixels from left
The filled bar is simply a visual representation of how much of a given propellant resource remains; much like in the RefuelMFD, and others like it.
Obviously, if PR is greater than 350, the bar will appear off-scale, so I need to mathematically scale the bar to fit within a certain range.
I realize that the answer/formula for this is most likely rediculously simple, but after an hour of trying on my own (I can be stubborn that way) I can't figure it out.
I ask the community for a little help again.:shrug: