Difference between revisions of "GSDP:GAM100/CProcessing/text()"

>Zachary.logsdon
(New page: {{GSDP:GAM100API.css}} = text() = == Description == The text functions draws a string to the screen with input parameters. It uses the settings set by the text functions mentioned in. ==...)
 
>Zachary.logsdon
 
(One intermediate revision by the same user not shown)
Line 19: Line 19:
  
 
     // Set it to be red text
 
     // Set it to be red text
     fill(255, 0, 0, 255);
+
     fill(color(255, 0, 0, 255));
  
 
     // Draw the word  TESTING in the upper left corner
 
     // Draw the word  TESTING in the upper left corner
Line 34: Line 34:
 
* [[GSDP:GAM100/CProcessing/textFont()                |textFont()              ]]
 
* [[GSDP:GAM100/CProcessing/textFont()                |textFont()              ]]
 
* [[GSDP:GAM100/CProcessing/textSize()                |textSize()              ]]
 
* [[GSDP:GAM100/CProcessing/textSize()                |textSize()              ]]
 +
* [[GSDP:GAM100/CProcessing/textAlign()              |textAlign()              ]]

Latest revision as of 14:45, 5 October 2019

text()

Description

The text functions draws a string to the screen with input parameters. It uses the settings set by the text functions mentioned in.

Parameters

text( const char* text, float x, float y)

  • text - (const char *) The string to draw on the screen in font
  • x - (float) The x position to draw at. Left side of the text.
  • y - (float) The y position to draw at. Bottom of the text.

Example

{
    //Set a size for the text
    textSize(30.0f);

    // Set it to be red text
    fill(color(255, 0, 0, 255));

    // Draw the word  TESTING in the upper left corner
    text("TESTING", 0.0f, 30.0f);
}

Related