Garry's Mod Wiki

DProperty_VectorColor

DProperty_VectorColor

Description

Color picker control for a DProperties panel. Opens a DColorCombo if the color preview is clicked.

See Editable Entities for how this is used ingame.

Parent

Derives methods, etc not listed on this page from DProperty_Generic.

Methods

DProperty_VectorColor:Setup( string prop = "VectorColor", table settings )
This is used internally - although you're able to use it you probably shouldn't. Called by a property row to setup a color selection control.
DProperty_VectorColor:SetValue( Vector color )
Sets the color value of the property.

Example

Creates a demo VectorColor property.

local Panel = vgui.Create( "DFrame" ) Panel:SetSize( 500, 500 ) Panel:MakePopup() local props = vgui.Create( "DProperties", Panel ) props:Dock( FILL ) local colorPicker = props:CreateRow( "Color", "Select Color" ) colorPicker:Setup( "VectorColor", {} ) colorPicker:SetValue( Vector( 0.61, 0.1, 0.1 ) ) colorPicker.DataChanged = function( self, data ) MsgN( "Selected color: ", data ) end

Special Pages


Wikis

?

Render Time: 23ms

DB GetPage 2
Generate Html 5
SaveChanges (1) 6
Render Body 0
Render Sidebar 6