surface.SetTextColor

From GMod Wiki

Jump to: navigation, search
Function
Syntax surface.SetTextColor( Number red, Number green, Number blue, Number alpha )
Where is this used?
Description:
Sets the current text color
Returns: nil
Part of Library: surface
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Surface.SetTextColor]Surface.SetTextColor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionDraws red text in the middle of the screen
Used onNewerClient.png
Code
function redText()
    surface.SetTextColor( 255, 0, 0, 255 )
    surface.SetTextPos( ScrW() / 2 - 20, ScrH() / 2 - 20)
    surface.DrawText( "I R ANGRY RED TEXT RAWR" )
end
 
hook.Add("HUDPaint", "drawRedText", RedText)
OutputDraws red "I R ANGRY RED TEXT RAWR" in the middle of the screen.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox