Garry's Mod Wiki

DTextEntry:SetCursorColor

  DTextEntry:SetCursorColor( table color )

Description

Sets the cursor's color in DTextEntry (the blinking line).

Arguments

1 table color
The color to set the cursor to.

Example

Creates a panel and a DTextEntry, and then sets the cursor color. (As seen on https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index9051.html)

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()
Output: Makes the text entry's cursor color red.