Panel Meta
Panel management system for the Lilia framework.
Overview
The panel meta table provides comprehensive functionality for managing VGUI panels, UI interactions, and panel operations in the Lilia framework. It handles panel event listening, inventory synchronization, UI updates, and panel-specific operations. The meta table operates primarily on the client side, with the server providing data that panels can listen to and display. It includes integration with the inventory system for inventory change notifications, character system for character data display, network system for data synchronization, and UI system for panel management. The meta table ensures proper panel event handling, inventory synchronization, UI updates, and comprehensive panel lifecycle management from creation to destruction.
liaListenForInventoryChanges
đ Purpose
Sets up event listeners for inventory changes on a panel
â° When Called
When a UI panel needs to respond to inventory modifications, typically during panel initialization
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
inventory |
Inventory | The inventory object to listen for changes on |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
-- Simple: Set up inventory listening for a basic panel
panel:liaListenForInventoryChanges(playerInventory)
đ Medium Complexity
-- Medium: Set up inventory listening with conditional setup
if playerInventory then
characterPanel:liaListenForInventoryChanges(playerInventory)
end
âī¸ High Complexity
-- High: Set up inventory listening for multiple panels with error handling
local panels = {inventoryPanel, characterPanel, equipmentPanel}
for _, pnl in ipairs(panels) do
if IsValid(pnl) and playerInventory then
pnl:liaListenForInventoryChanges(playerInventory)
end
end
liaDeleteInventoryHooks
đ Purpose
Removes inventory change event listeners from a panel
â° When Called
When a panel no longer needs to listen to inventory changes, during cleanup, or when switching inventories
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
id |
number | The specific inventory ID to remove hooks for, or nil to remove all hooks |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Clean up hooks when closing a panel
if IsValid(panel) then
panel:liaDeleteInventoryHooks()
end
âī¸ High Complexity
-- High: Clean up multiple panels with different inventory IDs
local panels = {inventoryPanel, equipmentPanel, storagePanel}
local inventoryIDs = {playerInvID, equipmentInvID, storageInvID}
for i, pnl in ipairs(panels) do
if IsValid(pnl) then
pnl:liaDeleteInventoryHooks(inventoryIDs[i])
end
end
setScaledPos
đ Purpose
Sets the position of a panel with automatic screen scaling
â° When Called
When positioning UI elements that need to adapt to different screen resolutions
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
x |
number | The horizontal position value to be scaled |
y |
number | The vertical position value to be scaled |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Position panel based on screen dimensions
local x = ScrW() * 0.5 - 200
local y = ScrH() * 0.3
panel:setScaledPos(x, y)
âī¸ High Complexity
-- High: Position multiple panels with responsive layout
local panels = {mainPanel, sidePanel, footerPanel}
local positions = {
{ScrW() * 0.1, ScrH() * 0.1},
{ScrW() * 0.7, ScrH() * 0.1},
{ScrW() * 0.1, ScrH() * 0.8}
}
for i, pnl in ipairs(panels) do
if IsValid(pnl) then
pnl:setScaledPos(positions[i][1], positions[i][2])
end
end
setScaledSize
đ Purpose
Sets the size of a panel with automatic screen scaling
â° When Called
When sizing UI elements that need to adapt to different screen resolutions
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
w |
number | The width value to be scaled |
h |
number | The height value to be scaled |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Set size based on screen proportions
local w = ScrW() * 0.8
local h = ScrH() * 0.6
panel:setScaledSize(w, h)
âī¸ High Complexity
-- High: Set sizes for multiple panels with responsive layout
local panels = {mainPanel, sidePanel, footerPanel}
local sizes = {
{ScrW() * 0.7, ScrH() * 0.6},
{ScrW() * 0.25, ScrH() * 0.6},
{ScrW() * 0.95, ScrH() * 0.1}
}
for i, pnl in ipairs(panels) do
if IsValid(pnl) then
pnl:setScaledSize(sizes[i][1], sizes[i][2])
end
end
On
đ Purpose
Sets the size of a panel with automatic screen scaling
â° When Called
When sizing UI elements that need to adapt to different screen resolutions
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
w |
number | The width value to be scaled |
h |
number | The height value to be scaled |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Set size based on screen proportions
local w = ScrW() * 0.8
local h = ScrH() * 0.6
panel:setScaledSize(w, h)
âī¸ High Complexity
-- High: Set sizes for multiple panels with responsive layout
local panels = {mainPanel, sidePanel, footerPanel}
local sizes = {
{ScrW() * 0.7, ScrH() * 0.6},
{ScrW() * 0.25, ScrH() * 0.6},
{ScrW() * 0.95, ScrH() * 0.1}
}
for i, pnl in ipairs(panels) do
if IsValid(pnl) then
pnl:setScaledSize(sizes[i][1], sizes[i][2])
end
end
SetupTransition
đ Purpose
Sets the size of a panel with automatic screen scaling
â° When Called
When sizing UI elements that need to adapt to different screen resolutions
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
w |
number | The width value to be scaled |
h |
number | The height value to be scaled |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Set size based on screen proportions
local w = ScrW() * 0.8
local h = ScrH() * 0.6
panel:setScaledSize(w, h)
âī¸ High Complexity
-- High: Set sizes for multiple panels with responsive layout
local panels = {mainPanel, sidePanel, footerPanel}
local sizes = {
{ScrW() * 0.7, ScrH() * 0.6},
{ScrW() * 0.25, ScrH() * 0.6},
{ScrW() * 0.95, ScrH() * 0.1}
}
for i, pnl in ipairs(panels) do
if IsValid(pnl) then
pnl:setScaledSize(sizes[i][1], sizes[i][2])
end
end
FadeHover
đ Purpose
Adds a fade hover effect to a panel that transitions opacity based on hover state
â° When Called
When initializing a panel that should have a visual hover effect with opacity transition
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color to use for the hover effect. Defaults to Color(255, 255, 255, 30) |
speed |
number, optional | The transition speed for the fade effect. Defaults to 6 |
rad |
number, optional | The border radius for rounded corners. If provided, uses rounded box drawing |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
-- High: Add fade hover with rounded corners and custom styling
panel:FadeHover(Color(255, 200, 0, 40), 10, 8)
BarHover
đ Purpose
Adds a horizontal bar hover effect that expands from the center when hovered
â° When Called
When initializing a panel that should display a bottom bar indicator on hover
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the hover bar. Defaults to Color(255, 255, 255, 255) |
height |
number, optional | The height of the hover bar in pixels. Defaults to 2 |
speed |
number, optional | The transition speed for the bar expansion. Defaults to 6 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
FillHover
đ Purpose
Adds a fill hover effect that expands from a specified direction when hovered
â° When Called
When initializing a panel that should have a directional fill effect on hover
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the fill effect. Defaults to Color(255, 255, 255, 30) |
dir |
number, optional | The direction for the fill effect (LEFT, TOP, RIGHT, BOTTOM). Defaults to LEFT |
speed |
number, optional | The transition speed for the fill expansion. Defaults to 8 |
mat |
Material, optional | Optional material to use for the fill instead of solid color |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add fill hover from bottom with custom color
panel:FillHover(Color(100, 200, 255), BOTTOM, 10)
âī¸ High Complexity
-- High: Add fill hover with material texture
panel:FillHover(Color(255, 255, 255), RIGHT, 8, gradientMaterial)
Background
đ Purpose
Sets a background color for a panel with optional rounded corners
â° When Called
When initializing a panel that needs a colored background
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color | The background color to use |
rad |
number, optional | The border radius for rounded corners. If 0 or nil, uses square corners |
rtl |
boolean, optional | Top-left corner rounding. If nil, all corners use rad |
Top |
unknown | left corner rounding. If nil, all corners use rad |
Top |
unknown | left corner rounding. If nil, all corners use rad |
rtr |
boolean, optional | Top-right corner rounding |
Top |
unknown | right corner rounding |
Top |
unknown | right corner rounding |
rbl |
boolean, optional | Bottom-left corner rounding |
Bottom |
unknown | left corner rounding |
Bottom |
unknown | left corner rounding |
rbr |
boolean, optional | Bottom-right corner rounding |
Bottom |
unknown | right corner rounding |
Bottom |
unknown | right corner rounding |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
-- High: Add background with custom corner rounding
panel:Background(Color(30, 30, 40), 10, true, true, false, false)
Material
đ Purpose
Sets a material texture as the panel background
â° When Called
When initializing a panel that should display a material texture
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
mat |
Material | The material to display |
col |
Color, optional | The color tint to apply to the material. Defaults to Color(255, 255, 255) |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add material with color tint
panel:Material(Material("icon16/star.png"), Color(255, 200, 0))
âī¸ High Complexity
-- High: Add material with custom color and effects
panel:Material(customMaterial, Color(100, 150, 255, 200))
TiledMaterial
đ Purpose
Sets a tiled material texture that repeats across the panel background
â° When Called
When initializing a panel that should display a repeating tiled texture
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
mat |
Material | The material to tile |
tw |
number | The tile width in pixels |
th |
number | The tile height in pixels |
col |
Color, optional | The color tint to apply. Defaults to Color(255, 255, 255, 255) |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add tiled material with color tint
panel:TiledMaterial(Material("pattern.png"), 32, 32, Color(200, 200, 200))
âī¸ High Complexity
-- High: Add tiled material with custom styling
panel:TiledMaterial(customPattern, 16, 16, Color(150, 150, 255, 180))
Outline
đ Purpose
Adds an outline border around the panel
â° When Called
When initializing a panel that needs a visible border outline
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the outline. Defaults to Color(255, 255, 255, 255) |
width |
number, optional | The width of the outline in pixels. Defaults to 1 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
LinedCorners
đ Purpose
Adds corner line decorations to the panel (L-shaped corners)
â° When Called
When initializing a panel that needs decorative corner lines
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the corner lines. Defaults to Color(255, 255, 255, 255) |
cornerLen |
number, optional | The length of each corner line segment. Defaults to 15 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
SideBlock
đ Purpose
Adds a colored block on a specific side of the panel
â° When Called
When initializing a panel that needs a side indicator or accent block
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the side block. Defaults to Color(255, 255, 255, 255) |
size |
number, optional | The size/thickness of the block. Defaults to 3 |
side |
number, optional | The side to place the block (LEFT, TOP, RIGHT, BOTTOM). Defaults to LEFT |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
Text
đ Purpose
Adds text rendering to a panel with optional styling
â° When Called
When initializing a panel that should display text
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
text |
string | The text to display |
font |
string, optional | The font to use. Defaults to "Trebuchet24" |
col |
Color, optional | The text color. Defaults to Color(255, 255, 255, 255) |
alignment |
number, optional | Text alignment (TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT). Defaults to TEXT_ALIGN_CENTER |
ox |
number, optional | Horizontal offset. Defaults to 0 |
oy |
number, optional | Vertical offset. Defaults to 0 |
paint |
boolean, optional | If true, forces Paint hook instead of using SetText methods |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add text with custom font and color
panel:Text("Title", "DermaDefault", Color(255, 200, 0))
âī¸ High Complexity
-- High: Add text with full customization
panel:Text("Label", "CustomFont", Color(100, 150, 255), TEXT_ALIGN_LEFT, 10, -5)
DualText
đ Purpose
Adds two lines of text to a panel, one on top and one on bottom
â° When Called
When initializing a panel that should display two text lines vertically
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
toptext |
string | The top text to display |
topfont |
string, optional | The font for the top text. Defaults to "Trebuchet24" |
topcol |
Color, optional | The color for the top text. Defaults to Color(0, 127, 255, 255) |
bottomtext |
string | The bottom text to display |
bottomfont |
string, optional | The font for the bottom text. Defaults to "Trebuchet18" |
bottomcol |
Color, optional | The color for the bottom text. Defaults to Color(255, 255, 255, 255) |
alignment |
number, optional | Text alignment. Defaults to TEXT_ALIGN_CENTER |
centerSpacing |
number, optional | Spacing between the two text lines. Defaults to 0 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add dual text with custom colors
panel:DualText("Name", nil, Color(255, 200, 0), "Description", nil, Color(200, 200, 200))
âī¸ High Complexity
-- High: Add dual text with full customization
panel:DualText("Top", "CustomFont1", Color(100, 150, 255), "Bottom", "CustomFont2", Color(255, 255, 255), TEXT_ALIGN_LEFT, 5)
Blur
đ Purpose
Adds a blur effect to the panel background
â° When Called
When initializing a panel that should have a blurred background effect
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
amount |
number, optional | The blur intensity. Defaults to 8 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
CircleClick
đ Purpose
Adds a circular ripple effect that appears when the panel is clicked
â° When Called
When initializing a panel that should show a click ripple animation
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the ripple effect. Defaults to Color(255, 255, 255, 50) |
speed |
number, optional | The animation speed of the ripple. Defaults to 5 |
trad |
number, optional | The target radius for the ripple. Defaults to panel width |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
-- High: Add click ripple with full customization
panel:CircleClick(Color(255, 200, 0, 100), 10, 200)
CircleHover
đ Purpose
Adds a circular hover effect that follows the cursor position
â° When Called
When initializing a panel that should show a circular hover effect
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the hover circle. Defaults to Color(255, 255, 255, 30) |
speed |
number, optional | The transition speed. Defaults to 6 |
trad |
number, optional | The target radius for the circle. Defaults to panel width |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
-- High: Add circle hover with full customization
panel:CircleHover(Color(255, 200, 0, 40), 10, 150)
SquareCheckbox
đ Purpose
Styles a checkbox panel with a square design and animated checkmark
â° When Called
When initializing a checkbox panel that should have a square style
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
inner |
Color, optional | The color of the inner checkmark. Defaults to Color(0, 255, 0, 255) |
outer |
Color, optional | The color of the outer border. Defaults to Color(255, 255, 255, 255) |
speed |
number, optional | The animation speed for the checkmark. Defaults to 14 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add square checkbox with custom colors
checkbox:SquareCheckbox(Color(0, 200, 255), Color(200, 200, 200), 10)
âī¸ High Complexity
-- High: Add square checkbox with full customization
checkbox:SquareCheckbox(Color(100, 255, 100), Color(255, 255, 255), 16)
CircleCheckbox
đ Purpose
Styles a checkbox panel with a circular design and animated checkmark
â° When Called
When initializing a checkbox panel that should have a circular style
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
inner |
Color, optional | The color of the inner checkmark. Defaults to Color(0, 255, 0, 255) |
outer |
Color, optional | The color of the outer border. Defaults to Color(255, 255, 255, 255) |
speed |
number, optional | The animation speed for the checkmark. Defaults to 14 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add circle checkbox with custom colors
checkbox:CircleCheckbox(Color(0, 200, 255), Color(200, 200, 200), 10)
âī¸ High Complexity
-- High: Add circle checkbox with full customization
checkbox:CircleCheckbox(Color(100, 255, 100), Color(255, 255, 255), 16)
AvatarMask
đ Purpose
Creates an avatar image with a custom mask shape
â° When Called
When initializing a panel that should display a masked avatar image
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
mask |
function | A function that draws the mask shape: function(panel, width, height) |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
-- Simple: Add avatar mask with circle
panel:AvatarMask(function(_, w, h) drawCircle(w/2, h/2, w/2) end)
đ Medium Complexity
-- Medium: Add avatar mask with custom shape
panel:AvatarMask(function(_, w, h) draw.RoundedBox(8, 0, 0, w, h, color_white) end)
âī¸ High Complexity
-- High: Add avatar mask with complex shape
panel:AvatarMask(function(_, w, h)
-- Custom mask drawing code
end)
CircleAvatar
đ Purpose
Creates a circular avatar image panel
â° When Called
When initializing a panel that should display a circular avatar
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add circular avatar and set player
panel:CircleAvatar()
panel:SetPlayer(LocalPlayer(), 64)
âī¸ High Complexity
-- High: Add circular avatar with full setup
panel:CircleAvatar()
panel:SetPlayer(targetPlayer, 128)
Circle
đ Purpose
Draws a filled circle on the panel
â° When Called
When initializing a panel that should display a circle shape
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the circle. Defaults to Color(255, 255, 255, 255) |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
CircleFadeHover
đ Purpose
Adds a circular fade hover effect that transitions opacity on hover
â° When Called
When initializing a panel that should have a circular fade hover effect
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the hover circle. Defaults to Color(255, 255, 255, 30) |
speed |
number, optional | The transition speed. Defaults to 6 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add circle fade hover with custom color
panel:CircleFadeHover(Color(100, 150, 255, 50), 8)
âī¸ High Complexity
-- High: Add circle fade hover with full customization
panel:CircleFadeHover(Color(255, 200, 0, 40), 10)
CircleExpandHover
đ Purpose
Adds a circular hover effect that expands from the center on hover
â° When Called
When initializing a panel that should have an expanding circle hover effect
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color, optional | The color of the hover circle. Defaults to Color(255, 255, 255, 30) |
speed |
number, optional | The transition speed. Defaults to 6 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Add circle expand hover with custom color
panel:CircleExpandHover(Color(100, 150, 255, 50), 8)
âī¸ High Complexity
-- High: Add circle expand hover with full customization
panel:CircleExpandHover(Color(255, 200, 0, 40), 10)
Gradient
đ Purpose
Adds a gradient effect to the panel background
â° When Called
When initializing a panel that should have a gradient background
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
col |
Color | The gradient color |
dir |
number, optional | The gradient direction (LEFT, TOP, RIGHT, BOTTOM). Defaults to BOTTOM |
frac |
number, optional | The gradient fraction (0-1). Defaults to 1 |
op |
boolean, optional | If true, reverses the gradient direction |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
-- High: Add gradient with full customization
panel:Gradient(Color(100, 150, 255, 180), RIGHT, 0.8, true)
SetOpenURL
đ Purpose
Sets the panel to open a URL when clicked
â° When Called
When initializing a panel that should open a URL on click
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
url |
string | The URL to open when the panel is clicked |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
NetMessage
đ Purpose
Sets the panel to send a network message when clicked
â° When Called
When initializing a panel that should send network data on click
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
name |
string | The network message name to send |
data |
function, optional | A function that prepares the network message: function(panel) |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Send network message with data
panel:NetMessage("liaAction", function(pnl)
net.WriteString("action_name")
end)
âī¸ High Complexity
-- High: Send network message with complex data
panel:NetMessage("liaComplexAction", function(pnl)
net.WriteString(pnl.actionType)
net.WriteEntity(pnl.target)
net.WriteTable(pnl.data)
end)
Stick
đ Purpose
Docks the panel to its parent with optional margin
â° When Called
When initializing a panel that should be docked to its parent
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
dock |
number, optional | The dock direction (FILL, LEFT, TOP, RIGHT, BOTTOM). Defaults to FILL |
margin |
number, optional | The margin size in pixels. Defaults to 0 |
dontInvalidate |
boolean, optional | If true, doesn't invalidate the parent layout |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
DivTall
đ Purpose
Sets the panel height to a fraction of the target panel's height
â° When Called
When initializing a panel that should be a fraction of another panel's height
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
frac |
number, optional | The fraction to divide by. Defaults to 2 (half height) |
target |
Panel, optional | The target panel to measure from. Defaults to parent panel |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
DivWide
đ Purpose
Sets the panel width to a fraction of the target panel's width
â° When Called
When initializing a panel that should be a fraction of another panel's width
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
frac |
number, optional | The fraction to divide by. Defaults to 2 (half width) |
target |
Panel, optional | The target panel to measure from. Defaults to parent panel |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
SquareFromHeight
đ Purpose
Sets the panel width to match its height, making it square
â° When Called
When initializing a panel that should be square based on height
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
SquareFromWidth
đ Purpose
Sets the panel height to match its width, making it square
â° When Called
When initializing a panel that should be square based on width
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
SetRemove
đ Purpose
Sets the panel to remove a target panel when clicked
â° When Called
When initializing a panel that should remove another panel on click
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
target |
Panel, optional | The panel to remove. Defaults to self |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
-- High: Remove specific panel with validation
if IsValid(targetPanel) then
button:SetRemove(targetPanel)
end
FadeIn
đ Purpose
Animates the panel to fade in from transparent
â° When Called
When initializing a panel that should fade in on creation
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
time |
number, optional | The fade in duration in seconds. Defaults to 0.2 |
alpha |
number, optional | The target alpha value. Defaults to 255 |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
HideVBar
đ Purpose
Hides the vertical scrollbar of a scrollable panel
â° When Called
When initializing a scrollable panel that should hide its scrollbar
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
SetTransitionFunc
đ Purpose
Sets a custom transition function for SetupTransition
â° When Called
When setting up a panel that needs a custom transition condition
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
fn |
function | The transition function: function(panel) returns boolean |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Set transition with custom condition
panel:SetTransitionFunc(function(s) return s.value > 0 end)
âī¸ High Complexity
-- High: Set transition with complex condition
panel:SetTransitionFunc(function(s)
return s:IsHovered() and s.enabled
end)
SetTransitionFunc
đ Purpose
Sets a custom transition function for SetupTransition
â° When Called
When setting up a panel that needs a custom transition condition
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
fn |
function | The transition function: function(panel) returns boolean |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Set transition with custom condition
panel:SetTransitionFunc(function(s) return s.value > 0 end)
âī¸ High Complexity
-- High: Set transition with complex condition
panel:SetTransitionFunc(function(s)
return s:IsHovered() and s.enabled
end)
ClearTransitionFunc
đ Purpose
Clears the custom transition function
â° When Called
When removing a custom transition function from a panel
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
ClearTransitionFunc
đ Purpose
Clears the custom transition function
â° When Called
When removing a custom transition function from a panel
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
SetAppendOverwrite
đ Purpose
Sets a custom append overwrite function for the On method
â° When Called
When setting up a panel that needs custom hook name modification
âī¸ Parameters
| Parameter | Type | Description |
|---|---|---|
fn |
string or function | The hook name to use instead of the default |
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
ClearAppendOverwrite
đ Purpose
Clears the custom append overwrite function
â° When Called
When removing a custom append overwrite from a panel
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
ClearPaint
đ Purpose
Removes the Paint function from the panel
â° When Called
When initializing a panel that should not have custom painting
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
ClearPaint
đ Purpose
Removes the Paint function from the panel
â° When Called
When initializing a panel that should not have custom painting
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
âī¸ High Complexity
ReadyTextbox
đ Purpose
Prepares a textbox panel with custom styling and transition setup
â° When Called
When initializing a textbox that should have custom styling
âŠī¸ Returns
- Nothing
đ Realm
Client
đĄ Example Usage
đ° Low Complexity
đ Medium Complexity
-- Medium: Prepare textbox with setup
local textbox = vgui.Create("DTextEntry")
textbox:ReadyTextbox()
âī¸ High Complexity
-- High: Prepare textbox with full setup
local textbox = vgui.Create("DTextEntry")
textbox:SetSize(200, 30)
textbox:ReadyTextbox()