GetColor Examples TextRenderer renderer( ... );
// Get the color of the text // Rgba color = renderer.GetColor(); // Hint: You can do the following to pring text with a shadow // string text = "Some text"; int x = 200; int y = 100; // Store the original text color // Rgba originalColor = renderer.GetColor(); // Select a translucent black color for the shadow (30% opacity) // renderer.SetColor( Rgba( 0.0, 0.0, 0.0, 0.30 )); // Render the shadow of the text slightly below and left of the original text position // renderer.Print( text, x-1, y+1 ); // Change the text color back to the original // renderer.SetColor( originalColor ); // Print the text on top of the shadow // renderer.Print( text, x, y ); Other functions of the class TextRenderer
Questions about GetColor? Click here. |