Ryan Scorpion
Member
Hi,
Recently I've been reworking a bar in my game to signify when a gun is overheating etc, simple stuff. However, I was wondering if it was possible to draw it in the form of a curved rectangle as shown below:
Rather annoyingly, trying to search a solution online comes up with how to draw a rectangle with rounded edges which is a built in function but not what I'm looking for.
At least when I looked it up it said the above shape was a curved rectangle...
Drawing the outline I think is do-able, all you need are two (I guess you could call them parallel?) parts of a circumference of a circle and connect them using two lines at each end.
However since I need this as a progress bar: I would need to fill it in which I can't seem to wrap my head around let alone if it's even possible in GMS2
This would also be attached to the cursor so it would need to fit with all kind of backgrounds so I can't use sprites or similar unfortunately.
I've looked into Vectors and Primitives since I've heard you can draw incredibly complex shapes with them but I'm yet to find a way to make this with them unless I were to create a massive number of vectors for the curved areas and draw accordingly but that seems inefficient...
If someone could point me in the right direction or let me know whether or not it's possible that would be great!
Thanks for reading!
Recently I've been reworking a bar in my game to signify when a gun is overheating etc, simple stuff. However, I was wondering if it was possible to draw it in the form of a curved rectangle as shown below:
Rather annoyingly, trying to search a solution online comes up with how to draw a rectangle with rounded edges which is a built in function but not what I'm looking for.
At least when I looked it up it said the above shape was a curved rectangle...
Drawing the outline I think is do-able, all you need are two (I guess you could call them parallel?) parts of a circumference of a circle and connect them using two lines at each end.
However since I need this as a progress bar: I would need to fill it in which I can't seem to wrap my head around let alone if it's even possible in GMS2
This would also be attached to the cursor so it would need to fit with all kind of backgrounds so I can't use sprites or similar unfortunately.
I've looked into Vectors and Primitives since I've heard you can draw incredibly complex shapes with them but I'm yet to find a way to make this with them unless I were to create a massive number of vectors for the curved areas and draw accordingly but that seems inefficient...
If someone could point me in the right direction or let me know whether or not it's possible that would be great!
Thanks for reading!