Round Bars! Very customizable: size,color or texture, gap, thickness, precision.
Very easy to implement and doesnt require any extra objects or initilization scripts.
Performance tested and diffrent "prototypes" tried, ones with blendmodes and draw_vertex_color but those all didn't work as well as this one.
use:
draw_circbar_tex(x,y,radius,opening,percent,thickness,precision,sprite)
or:
draw_circbar_col(x,y,radius,opening,percent,thickness,precision,backcolor,barcolor)
example:
draw_circbar_col(100,100,50,20,health/100,20,100,c_black,c_red)
explanation for every argument:
x,y- obvious, x and y coordinates. defines the left upper corner, not the middle
radius- how big the circle has to be. A radius of 50 means 100 pixels in total width.
opening- if you want to leave out a part of the circle at the bottom(for aesthetic reasons). goes from 0 to 180 where 0 is a full circle and 180 is practicly nothing.
percent- how much the bar should be filled with a texture or color. goes from 0 to 1. not from 0 to 100. will give an error outside that range.
thickness- how thick the bar should be. expands to the middle. A higher thickness than the radius can give weird results.
precision- Kind of works like draw_set_circle_precision. how many segments the bar exists of. A higher opening value will not affect a circles quality. A to high value can lead to game maker refusing to draw parts of it.(max amount of draw_vertex calls).
texture- Needs to be a sprite, any size is oke. background on image 0 and foreground/bar on image 1. not every part or your sprite may be rendered, especially in the corners.
backcolor- color of the background.
barcolor- color of the bar.
I hope this is usefull to you!
End User Licence Agreement (EULA).