energy bar : drawrect alternative
BlitzMax Forums/BlitzMax Beginners Area/energy bar : drawrect alternative
| ||
Hi ! At this time i use drawrect into my game to draw the 'energy' bar used by the player space ship beam : Is there another method to not use drawrect (slow) for this energy bar ? (when the player shoot the beam energy bar decrease by one pixel) Thanks for your ideas ! |
| ||
A rect image with setscale? <edit> Setviewport? <edit2> drawimagerect? |
| ||
I draw 'progress' bars with three images. One stretched horizontally for the center part, then a rounded image at either end. |
| ||
Is draw rect slow then? I'd have thought it was very fast. Yeah basically make an image which is your bar and only draw a portion of it. Don't use setviewport because it's unreliable on some PCs. You've got my framework haven't you? Use ccDrawImageArea instead. |
| ||
I do what Gfk does. Three images, although you could just do it with one if you don't want rounded ends. Just make use of the normal DrawImage and SetScale commands. |
| ||
Yeah basically make an image which is your bar and only draw a portion of it. i did this with blitzplus. With bmax your ccDrawImageArea could be a solution (for 'graphics' bars as colors gradient). Hope it's work on all the PC. (before this my first attemps with setviewport was awfull !!!). Is it really fast ? I draw 'progress' bars with three images i hope that setscale is not a 'too slow' command ! it's a good idea too ! Thanks for your ideas ! |
| ||
SetScale is fast. You'll use it a lot. |
| ||
Yeah I use setscale all the time for like hundreds of spinning particles. |