DFrame/SetSizable

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
 
Line 12: Line 12:
 
}}
 
}}
 
{{Example
 
{{Example
|Description=A snipped of code that makes a frame resizable and sets the minimum size to its current size.
+
|Description=A snippet of code that makes a frame resizable and sets the minimum size to its current size.
 
|Code=frame:SetSizable( true )
 
|Code=frame:SetSizable( true )
 
frame:SetMinWidth( frame:GetWide() )
 
frame:SetMinWidth( frame:GetWide() )
 
frame:SetMinHeight( frame:GetTall() )
 
frame:SetMinHeight( frame:GetTall() )
 
}}
 
}}

Latest revision as of 17:19, 7 January 2020

 DFrame:SetSizable( )

Contents

DescriptionPanelFunc

Sets whether or not the DFrame can be resized by the user.

This is achieved by clicking and dragging in the bottom right corner of the frame.

You can set the minimum size using DFrame:SetMinWidth and DFrame:SetMinHeight.

Arguments

boolean sizeable

Whether the frame should be resizeable or not.

Examples

Example

A snippet of code that makes a frame resizable and sets the minimum size to its current size.

frame:SetSizable( true )
frame:SetMinWidth( frame:GetWide() )
frame:SetMinHeight( frame:GetTall() )


Personal tools
Navigation