DTextEntry.SetCursorColor

From GMod Wiki

Jump to: navigation, search
Function
Syntax DTextEntry:SetCursorColor( Color Cursor Color )
Where is this used?
Description:
Sets the cursor color of a DTextEntry.
Returns: nil
Part of Library: DTextEntry
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DTextEntry.SetCursorColor]DTextEntry.SetCursorColor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionSets the cursor color of a DTextEntry object to red.
Used onNewerClient.png
Code
local ParentPanel = vgui.Create("DFrame")
	ParentPanel:SetSize(ScrW()/7, ScrH()/12)
	ParentPanel:Center()
	ParentPanel:SetTitle("Cursor Color Test")
	ParentPanel:SetDeleteOnClose(true)
	ParentPanel:MakePopup()
 
local TextEntry = vgui.Create( "DTextEntry", ParentPanel )
	TextEntry:SetSize(ScrW()/9, ScrH()/30)
	TextEntry:SetValue("Cursor Color Test ")
	TextEntry:SetPos(ParentPanel:GetWide()/2-TextEntry:GetWide()/2,
	ParentPanel:GetTall()/2-TextEntry:GetTall()/5)
	TextEntry:SetEnterAllowed(false)
 
	-- Uses Simple RGBA (Red, Green, Blue, Alpha) Colors. --
	TextEntry:SetCursorColor(Color(255,0,0,255))
 
	TextEntry:RequestFocus()
OutputDTextEntry RedCursor.png
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox