Category:DDragBase

From Garry's Mod
Jump to: navigation, search

Contents

DescriptionPanelPage

This is an internal function or feature.
This means you will be able to use it, but you really shouldn't.

A VGUI base panel providing drag/drop functionality. Used by DIconLayout, DListLayout and DTileLayout.

Inherited Functions

Inherits the following functions from DPanel and its parents up to 3 levels deep:


Examples

Example

local frame = vgui.Create( "DFrame" )
frame:SetSize( 300, 500 )
frame:Center()
frame:MakePopup()

local dragbase = vgui.Create( "DDragBase", frame )
dragbase:Dock( FILL )
dragbase:MakeDroppable( "test" )
dragbase:SetDropPos( "82" )

for i = 0, 10 do
	local butt = dragbase:Add( "DButton" )
	//butt:Dock( TOP )
	butt:SetPos( 25, i * 25 )
	butt:SetWidth( 100 )
	butt:Droppable( "test" )
	butt.id = i
	butt.Think = function( s ) s:SetText( "ID: " .. i .. " ZPOS: " .. s:GetZPos() ) end
end


Personal tools
Navigation