Different functions for filled and outlined shapes
There are two issues with how things are at the moment:
- The draw mode for shapes has to be specified all the time.
- The draw mode is mixed in with the conceptually distinct geometry information, except with
My proposal to fix these is to have different functions for filled and outlined shapes:
love.graphics.arc( x, y, radius, angle1, angle2, segments ) love.graphics.arcLine( x, y, radius, angle1, angle2, segments ) love.graphics.circle( x, y, radius, segments ) love.graphics.circleLine( x, y, radius, segments ) love.graphics.rectangle( x, y, width, height ) love.graphics.rectangleLine( x, y, width, height ) love.graphics.polygon( vertices ) love.graphics.polygonLine( vertices ) love.graphics.line( points )
Additional benefits are:
- There are less characters to type.
- It avoids the use of an enum. Using an enum, you have to be aware of what other values the enum can have. Here, the information is in the function name.
- Consistency of some sort. To the best of my knowledge, no other function which takes an argument to change the "style" of the function has such an argument without a default. (See
The only drawback I can see is that there are simply more functions. But, I think they result in a net decrease of complexity.