Difference between revisions of "Gb.display.setColor"

From Gamebuino Wiki
Jump to: navigation, search
m (Syntax)
(INVERT color added)
Line 4: Line 4:
 
Changes the color used to draw on the screen by all the display functions.
 
Changes the color used to draw on the screen by all the display functions.
  
The colors can be either <code>WHITE</code> or <code>BLACK</code> (actually these are just constants respectively equal to 0 and 1).
+
The colors can be either <code>WHITE</code>, <code>BLACK</code> or <code>INVERT</code>.
  
 
Most of the display functions only have one color, the foreground color. But some functions also have a background color:
 
Most of the display functions only have one color, the foreground color. But some functions also have a background color:
Line 10: Line 10:
 
* [[gb.display.drawChar]]
 
* [[gb.display.drawChar]]
 
* [[gb.display.print]]
 
* [[gb.display.print]]
 
To have a transparent background, set the background the same color as the foreground.
 
  
 
== Syntax ==
 
== Syntax ==
Line 17: Line 15:
  
 
== Parameters ==
 
== Parameters ==
* foregroundColor
+
* foregroundColor : <code>WHITE</code>, <code>BLACK</code> or <code>INVERT</code>
* backgroundColor ''(optional)''
+
* backgroundColor ''(optional)'' : <code>WHITE</code>, <code>BLACK</code> or <code>INVERT</code>. If no background color is specified, the background is transparent.
  
 
== Returns ==
 
== Returns ==

Revision as of 2014-09-07T12:45:51

Description

Changes the color used to draw on the screen by all the display functions.

The colors can be either WHITE, BLACK or INVERT.

Most of the display functions only have one color, the foreground color. But some functions also have a background color:

Syntax

gb.display.setColor(foregroundColor, backgroundColor);

Parameters

  • foregroundColor : WHITE, BLACK or INVERT
  • backgroundColor (optional) : WHITE, BLACK or INVERT. If no background color is specified, the background is transparent.

Returns

none

Example

See also