|
Post by u9 on Jun 30, 2006 13:02:31 GMT -5
There is a combined function for graphics.setX and graphics.setY called graphics.setXY. So I propose combining the following:
setScaleX and setScaleY --> setScaleXY( x, y ) setRows and setCols --> something like setTiles( x, y ) or similar setFrameWidth and setFrameHeight --> setFrameSize( x, y )
I also miss some more consistency in color values. Many functions require the color values given as separate values (e.g. graphics.setText), while others as one single value (e.g. graphics.clear). Others still, require seperate function calls (e.g. setR, setG, setB, setAlpha). I'm not sure what setR, setG, setB do or whether they can be combined, but there should be more consistency in these functions.
I would propose making a function RGB(r,g,b,a) or getRGBA(r,g,b,a) and then use this whenever a color value is needed.
|
|
|
Post by Guilect on Jul 1, 2006 8:57:19 GMT -5
Agreed. As Brutus2D grew and more commands were added, consistency sometimes got lost. Changing the command syntax to be more consistant would be ideal, however it will mean breaking existing code. I will study it.
The RGB and RGBA commands can be added. Maybe the next release, maybe the one after.
|
|
|
Post by u9 on Jul 1, 2006 9:27:36 GMT -5
I agree. Changing existing function signatures is very very bad and should be avoided as much as possible. So solutions should avoid this. But keep such things in mind when adding to the API. Consistency is important! One solution might be to add new functions to replace the old ones and mark the old ones as deprecated. But this also has problems I know, so I'm not sure what is best. C/C++ has function overloading where you might have a function e.g. clean(color) and clean(r,g,b) etc. but you probably already know this. Anyways this is probably impossible with a loose-typed language (variable types are not forced). Anyways, good luck what ever you do
|
|