Panel.StretchToParent

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:StretchToParent( Integer Left, Integer Top, Integer Right, Integer Bottom )
Description:
Stretches the object to the size of its parent, minus the given values.
Returns: nil
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.StretchToParent]Panel.StretchToParent [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionStretches a derma object to it's parent
Used onNewerClient.png
Code
local Frame = vgui.Create("DFrame")
Frame:SetSize( 300, 400 )
 
local Panel = vgui.Create("DPanel", Frame)
Panel:StretchToParent( 5, 30, 12, 44 ) --Tells it to position itself 5 pixels from the left of the frame, 30 from the top, 12 from the right, and 44 from the bottom
OutputStretchToParent.jpg
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox