|
I'd like to request added features, more methods in the Graphics.
The methods I'd like to see are being able to draw or fill by a specified alignment.
Consider:
g.fillRect(x,y,width,height)
draws from x,y and x+width towards y+height. It is vertically-aligned at top and horizontally-aligned to the left.
But sometimes you want to be able to draw in more ways than that, without the added complexities of calculating the alignment.
Instead there could be a Alignment enum containing all the alignment possible to draw with:
Alignment.Default = Alignment.TopLeft
Alignment.TopCenter
Alignment.TopRight
Alignment.MiddleRight
Alignment.BottomRight
Alignment.BottomCenter
Alignment.BottomLeft
Alignment.MiddleLeft
An example: Imagine a health-bar that starts from bottom-center, and not left-top as it usually does.
g.fillRect(200,200,4,100, Alignment.BottomCenter) // at 100% health
g.fillRect(200,200,4,50, Alignment.BottomCenter) // at 50% health
the same as:
g.fillRect(198,100,4,100) // at 100% health
g.fillRect(198,150,4,50) // at 50% health
Just for added convenience.
|