Basic Info Pane

This is a panel with the player's avatar on the left outlined in red, and some dual text to the right of it.

Preview

Code

local avCont = vgui.Create("DPanel", parent) -- Parent is just a DFrame
avCont:Stick(LEFT, 4) --Dock left, margin of 4 on all sides, invalidate parent
        :SquareFromHeight() --Sets the width to the height, making it a square
        :ClearPaint() -- Clears its background
        :Circle(Color(255, 0, 0, 255)) -- Draws a red circle as a background

local av = vgui.Create("DPanel", avCont) --Creating our actual avatar
av:Stick(FILL, 2) -- Dock fill, margin of 2 on all sides
av:CircleAvatar():SetPlayer(LocalPlayer(), 184) -- Make it a circle avatar and set the player to us

local text = vgui.Create("DPanel", parent) --Panel for our dual text
text:Stick(FILL, 4) -- Dock fill, margin of 4 on all sides
    :ClearPaint() -- Clear its background
    :DualText(
        "Line one", -- Top line
        "Trebuchet24", -- Top line font
        Color(255, 255, 255, 255), -- Top line color

        "Line two", -- Bottom line
        "Trebuchet18", -- Bottom line font
        Color(200, 200, 200, 200), -- Bottom line color

        TEXT_ALIGN_LEFT --Making it align to the left horizontally
    )

results matching ""

    No results matching ""