Revision Difference
surface.SetTextColor#565207
<function name="SetTextColor" parent="surface" type="libraryfunc">
	<description>Set the color of any future text to be drawn, can be set by either using R, G, B, A as separate numbers.
	<description>Set the color of any future text to be drawn, can be set by either using R, G, B, A as separate numbers or by providing a <page>Color</page>.
</description>
	<realm>Client and Menu</realm>
	<args>
		<arg name="r" type="number">The red value of color.</arg>
		<arg name="g" type="number">The green value of color</arg>
		<arg name="b" type="number">The blue value of color</arg>
		<arg name="a" type="number" default="255">The alpha value of color</arg>
	</args>
⤶
</function>⤶
	<args name="Use color object">⤶
		<arg name="color" type="table">A <page>Color</page> object/table to read the color from. This is slower than providing four numbers. You could use <page>Color:Unpack</page> to address this. You should also cache your color objects if you wish to use them, for performance reasons.</arg>⤶
	</args>⤶
</function>⤶
<example>
	<description>Draws 'Hello World', in white, near the top left of the screen.</description>
	<code>
hook.Add( "HUDPaint", "HUDPaint_DrawABox", function()
	surface.SetDrawColor( 0, 0, 0, 128 ) -- Set color for background
	surface.DrawRect( 100, 100, 128, 20 ) -- Draw background
	surface.SetTextColor( 255, 255, 255 ) -- Set text color
	surface.SetTextPos( 136, 104 ) -- Set text position, top left corner
	surface.SetFont( "Default" ) -- Set the font
	surface.DrawText( "Hello World" ) -- Draw the text
end )
	</code>
</example>
			Garry's Mod 
		
			Rust 
		
			Steamworks 
		
			Wiki Help