Post by Guilect on Jul 13, 2006 6:59:02 GMT -5
As several users have pointed out, there are some discrepancies among the commands which take as one of its parameters a color.
For example, to clear the screen you use graphics.clear color.
But, with text it is, graphics.settext "whatever", font, x,y, r,g,b,a
And with images there are separate commands to set each of the color components. (.setR, .setG, .setB, .setAlpha)
This is confusing to the user, never knowing what to use for parameters when trying to set the color of something.
In Brutus2D color is composed of 4 items. The Red, Green, and Blue components which define the color by adjusting the levels of these
and the Alpha component which defines how opaque or translucent the color is. For short this can be represented by ARGB.
The default color depth of Brutus2D is 32-bits. Therefore each of the color components can go from 0 to FF hex (0 to 255 decimal).
In order for a color input parameter to be consistent, any command looking for a color input will now use the following format: (if it is not already)
e.g.
COMMAND parameter, someother_parameter, color
where color is ARGB
for example with the clear command :
graphics.clear &hFFFF0000
where the &h means hex, the first byte "FF" (255 in decimal) means full Alpha, the next "FF" means full Red, then "00" no Green and "00" no Blue.
or you could use the decimal equivalent
graphics.clear -65536
or using a new command being introduced in v1.3 ARGB(a,r,g,b):
graphics.clear ARGB(&hFF, &hFF, &h00, &h00)
or in decimal
graphics.clear ARGB(255,255,0,0)
or of course these values can be variable, like so:
graphics.clear ARGB(w,x,y,z)
In order to make all the color inputs the same it will be necessary to change some of the existing commands format
In some cases new commands can easily be added to implement the consistent format.
For example, a new command .setcolor will be added to let you change the Alpha, Red, Green,and Blue (ARGB) of an image or a particle effect.
Like so -- graphics.setcolor image, &hFF00FF00.
The commands settext, setline, setrect, and setcircle will need to change.
This will cause you to need to change any occurrence of these commands in your source code to the new command format in order to run in version v1.3 or newer of Brutus2D
I apologize for the inconvenience that this will cause.
But, this change will make the language more consistent and easier for everyone to use.
Comments?
For example, to clear the screen you use graphics.clear color.
But, with text it is, graphics.settext "whatever", font, x,y, r,g,b,a
And with images there are separate commands to set each of the color components. (.setR, .setG, .setB, .setAlpha)
This is confusing to the user, never knowing what to use for parameters when trying to set the color of something.
In Brutus2D color is composed of 4 items. The Red, Green, and Blue components which define the color by adjusting the levels of these
and the Alpha component which defines how opaque or translucent the color is. For short this can be represented by ARGB.
The default color depth of Brutus2D is 32-bits. Therefore each of the color components can go from 0 to FF hex (0 to 255 decimal).
In order for a color input parameter to be consistent, any command looking for a color input will now use the following format: (if it is not already)
e.g.
COMMAND parameter, someother_parameter, color
where color is ARGB
for example with the clear command :
graphics.clear &hFFFF0000
where the &h means hex, the first byte "FF" (255 in decimal) means full Alpha, the next "FF" means full Red, then "00" no Green and "00" no Blue.
or you could use the decimal equivalent
graphics.clear -65536
or using a new command being introduced in v1.3 ARGB(a,r,g,b):
graphics.clear ARGB(&hFF, &hFF, &h00, &h00)
or in decimal
graphics.clear ARGB(255,255,0,0)
or of course these values can be variable, like so:
graphics.clear ARGB(w,x,y,z)
In order to make all the color inputs the same it will be necessary to change some of the existing commands format
In some cases new commands can easily be added to implement the consistent format.
For example, a new command .setcolor will be added to let you change the Alpha, Red, Green,and Blue (ARGB) of an image or a particle effect.
Like so -- graphics.setcolor image, &hFF00FF00.
The commands settext, setline, setrect, and setcircle will need to change.
This will cause you to need to change any occurrence of these commands in your source code to the new command format in order to run in version v1.3 or newer of Brutus2D
I apologize for the inconvenience that this will cause.
But, this change will make the language more consistent and easier for everyone to use.
Comments?