theundoing Posted April 22, 2012 Posted April 22, 2012 I am new to all this and i trying to make this. $hpperc = min((int) ($ir['hp'] / $ir['maxhp'] * 100), 100); $hpopp = 100 - $hpperc; <b>Health:</b> {$hpperc}%<br /> <img src='greenbar.png' width='$hpperc' height='10' /><img src='redbar.png' width='$hpopp' height='10' /> To work with this. <div class="stats"> Health100% <div style="padding-left: 19px;"> <div style="background: url(images/bg-bar.png) no-repeat;width:62px;height:26px;"> <div style="background: url(images/red-bar.png) no-repeat;width:62px;height:26px;"> <div style="color: #e4dfca;position: absolute;padding-top: 6px;padding-left:18px;">100%</div> </div></div></div> </div> If anyone can help that would be much appreciated. Quote
Dave Posted April 22, 2012 Posted April 22, 2012 Because his total width is 62px using the current $hpperc will do from 1-100px. You'll need to change your $hpperc line to something to the effect of. $hpperc = min((int) ($ir['hp'] / $ir['maxhp'] * 62), 62); Quote
theundoing Posted April 22, 2012 Author Posted April 22, 2012 I have used SomeRandomBastards way and it seems to work fine, but it kills the images. and i had a snip at the code and it dies on float: left;"></div> but with out the bars dont move with the % of health you have Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.