Skip to content

Instantly share code, notes, and snippets.

@samisalreadytaken
Last active December 29, 2022 20:05
Show Gist options
  • Select an option

  • Save samisalreadytaken/790cbbaecc8fdb0bd770cdd06e581442 to your computer and use it in GitHub Desktop.

Select an option

Save samisalreadytaken/790cbbaecc8fdb0bd770cdd06e581442 to your computer and use it in GitHub Desktop.
if ( CLIENT_DLL )
{
m_panel <- null;
function DisplayPanels()
{
if ( m_panel && m_panel.IsValid() )
return;
m_panel = vgui.CreatePanel( "Panel", vgui.GetClientDLLRootPanel(), "ExamplePanel" );
m_panel.MakeReadyForUse();
m_panel.SetPaintEnabled( true );
m_panel.SetPaintBackgroundEnabled( true );
m_panel.SetPaintBackgroundType( 2 );
m_panel.SetBgColor( 0, 0, 0, 120 );
m_panel.SetPos( XRES(32), YRES(64) );
m_panel.SetSize( ScreenWidth() - XRES(64), YRES(52) );
local image = vgui.CreatePanel( "AvatarImage", m_panel, "ExampleImage" );
image.MakeReadyForUse();
image.SetPaintEnabled( true );
image.SetSize( YRES(32), YRES(32) );
image.SetPos( XRES(8), (m_panel.GetTall() - image.GetTall())/2 );
image.SetShouldScaleImage( true );
// image.SetImage( "vgui/achievements/hl2_find_alllambdas", true );
image.SetPlayerByIndex( 1, 0 );
image.SetDefaultAvatar( "vgui/achievements/hl2_find_alllambdas" );
local label = vgui.CreatePanel( "Label", m_panel, "ExampleLabel" );
label.MakeReadyForUse();
label.SetPaintEnabled( true );
label.SetPaintBackgroundEnabled( false );
label.SetFgColor( 200, 200, 200, 255 );
label.SetPos( image.GetXPos() + image.GetWide(), 0 );
label.SetSize( m_panel.GetWide() - label.GetXPos(), m_panel.GetTall() );
label.SetContentAlignment( Alignment.center );
label.SetFont( surface.GetFont( "examplefont", true ) );
label.SetText( "Etiam ullamcorper arcu eu mauris molestie, a mollis ex maximus." );
}
function HidePanels()
{
if ( m_panel && m_panel.IsValid() )
{
m_panel.Destroy();
m_panel = null;
}
}
surface.CreateFont( "examplefont",
{
name = "Comic Sans MS",
tall = 26,
weight = 500,
antialias = true,
proportional = true
} );
}
versioninfo
{
"editorversion" "400"
"editorbuild" "6440"
"mapversion" "2"
"formatversion" "100"
"prefab" "0"
}
visgroups
{
}
viewsettings
{
"bSnapToGrid" "1"
"bShowGrid" "1"
"bShowLogicalGrid" "0"
"nGridSpacing" "8"
"bShow3DGrid" "0"
}
world
{
"id" "1"
"mapversion" "2"
"classname" "worldspawn"
"chaptertitlenomessage" "1"
"detailmaterial" "detail/detailsprites"
"detailvbsp" "detail.vbsp"
"maxpropscreenwidth" "-1"
"skyname" "sky_day01_01"
"vscriptlanguage_client" "-2"
solid
{
"id" "6"
side
{
"id" "12"
"plane" "(-288 288 288) (288 288 288) (288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.28125"
"vaxis" "[0 -1 0 0] 0.28125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "11"
"plane" "(-288 288 288) (-288 -288 288) (-288 -288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "10"
"plane" "(288 288 -32) (288 -288 -32) (288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 1 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "9"
"plane" "(288 288 288) (-288 288 288) (-288 288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "8"
"plane" "(288 -288 -32) (-288 -288 -32) (-288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "7"
"plane" "(256 -256 256) (256 256 256) (-256 256 256)"
"material" "DEV/REFLECTIVITY_10"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "18"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "8"
side
{
"id" "18"
"plane" "(-288 -288 -32) (288 -288 -32) (288 288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.28125"
"vaxis" "[0 -1 0 0] 0.28125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "17"
"plane" "(-288 288 288) (-288 -288 288) (-288 -288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "16"
"plane" "(288 288 -32) (288 -288 -32) (288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 1 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "15"
"plane" "(288 288 288) (-288 288 288) (-288 288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "14"
"plane" "(288 -288 -32) (-288 -288 -32) (-288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "13"
"plane" "(256 256 0) (256 -256 0) (-256 -256 0)"
"material" "DEV/REFLECTIVITY_10"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "18"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "10"
side
{
"id" "24"
"plane" "(-288 288 288) (-288 -288 288) (-288 -288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "23"
"plane" "(288 288 288) (-288 288 288) (-288 288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "22"
"plane" "(288 -288 -32) (-288 -288 -32) (-288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "21"
"plane" "(-256 256 256) (256 256 256) (256 -256 256)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "20"
"plane" "(-256 -256 0) (256 -256 0) (256 256 0)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "19"
"plane" "(-256 -256 0) (-256 -256 256) (-256 256 256)"
"material" "DEV/REFLECTIVITY_10"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "18"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "12"
side
{
"id" "30"
"plane" "(288 288 -32) (288 -288 -32) (288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 1 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "29"
"plane" "(288 288 288) (-288 288 288) (-288 288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "28"
"plane" "(288 -288 -32) (-288 -288 -32) (-288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "27"
"plane" "(-256 256 256) (256 256 256) (256 -256 256)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "26"
"plane" "(-256 -256 0) (256 -256 0) (256 256 0)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "25"
"plane" "(256 -256 256) (256 -256 0) (256 256 0)"
"material" "DEV/REFLECTIVITY_10"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "18"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "14"
side
{
"id" "36"
"plane" "(288 288 288) (-288 288 288) (-288 288 -32)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "35"
"plane" "(-256 256 256) (256 256 256) (256 -256 256)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "34"
"plane" "(-256 -256 0) (256 -256 0) (256 256 0)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "33"
"plane" "(-256 256 256) (-256 -256 256) (-256 -256 0)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "32"
"plane" "(256 256 0) (256 -256 0) (256 -256 256)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "31"
"plane" "(-256 256 0) (-256 256 256) (256 256 256)"
"material" "DEV/REFLECTIVITY_10"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "18"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
solid
{
"id" "16"
side
{
"id" "42"
"plane" "(288 -288 -32) (-288 -288 -32) (-288 -288 288)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.28125"
"vaxis" "[0 0 -1 -38.4] 0.3125"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "41"
"plane" "(-256 256 256) (256 256 256) (256 -256 256)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "40"
"plane" "(-256 -256 0) (256 -256 0) (256 256 0)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "39"
"plane" "(-256 256 256) (-256 -256 256) (-256 -256 0)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "38"
"plane" "(256 256 0) (256 -256 0) (256 -256 256)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "37"
"plane" "(-256 -256 256) (-256 -256 0) (256 -256 0)"
"material" "DEV/REFLECTIVITY_10"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 220 220"
"groupid" "18"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
group
{
"id" "18"
editor
{
"color" "220 220 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
}
entity
{
"id" "19"
"classname" "info_player_start"
"angles" "0 0 0"
"origin" "-64 0 16"
editor
{
"color" "0 255 0"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[0 1000]"
}
}
entity
{
"id" "32"
"classname" "logic_script_client"
"ClientThink" "0"
"RunOnServer" "1"
"targetname" "script"
"vscripts" "example_vgui.nut"
"origin" "-8 8 8"
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[0 1500]"
}
}
entity
{
"id" "64"
"classname" "func_button"
"disablereceiveshadows" "0"
"EFlags" "0"
"lip" "0"
"locked_sentence" "0"
"locked_sound" "0"
"movedir" "0 0 0"
"origin" "8 40 24"
"renderamt" "255"
"rendercolor" "255 255 255"
"renderfx" "0"
"rendermode" "0"
"sounds" "0"
"spawnflags" "1025"
"speed" "5"
"unlocked_sentence" "0"
"unlocked_sound" "0"
"viewhideflags" "0"
"wait" "0"
connections
{
"OnPressed" "script,CallScriptFunctionClient,DisplayPanels,0,-1"
}
solid
{
"id" "41"
side
{
"id" "66"
"plane" "(0 48 48) (16 48 48) (16 32 48)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "65"
"plane" "(0 32 0) (16 32 0) (16 48 0)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "64"
"plane" "(0 48 48) (0 32 48) (0 32 0)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "63"
"plane" "(16 48 0) (16 32 0) (16 32 48)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "62"
"plane" "(16 48 48) (0 48 48) (0 48 0)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "61"
"plane" "(16 32 0) (0 32 0) (0 32 48)"
"material" "DEV/DEV_MEASUREGENERIC01"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[0 3000]"
}
}
entity
{
"id" "99"
"classname" "func_button"
"disablereceiveshadows" "0"
"EFlags" "0"
"lip" "0"
"locked_sentence" "0"
"locked_sound" "0"
"movedir" "0 0 0"
"origin" "8 -24 24"
"renderamt" "255"
"rendercolor" "255 255 255"
"renderfx" "0"
"rendermode" "0"
"sounds" "0"
"spawnflags" "1025"
"speed" "5"
"unlocked_sentence" "0"
"unlocked_sound" "0"
"viewhideflags" "0"
"wait" "0"
connections
{
"OnPressed" "script,CallScriptFunctionClient,HidePanels,0,-1"
}
solid
{
"id" "100"
side
{
"id" "78"
"plane" "(0 -32 48) (0 -16 48) (16 -16 48)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "77"
"plane" "(0 -16 0) (0 -32 0) (16 -32 0)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 -1 0 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "76"
"plane" "(0 -32 0) (0 -16 0) (0 -16 48)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[0 -1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "75"
"plane" "(16 -16 0) (16 -32 0) (16 -32 48)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "74"
"plane" "(0 -16 0) (16 -16 0) (16 -16 48)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "73"
"plane" "(16 -32 0) (0 -32 0) (0 -32 48)"
"material" "DEV/DEV_MEASUREGENERIC01B"
"uaxis" "[1 0 0 0] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
}
}
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[0 3000]"
}
}
cameras
{
"activecamera" "-1"
}
cordon
{
"mins" "(-1024 -1024 -1024)"
"maxs" "(1024 1024 1024)"
"active" "0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment