Garry's Mod Wiki

Revision Difference

SpawnIcon#528853

<panel> <name>SpawnIcon</name> <parent>DButton</parent> <preview>SpawnIcon.jpg</preview> <description>A SpawnIcon displays an image for the given model path. It is mostly used in the Spawn Menu (Q).</description> <description>A "spawn icon" displays an image for the given model path. It is mostly used in the Spawn Menu (<key>Q</key>). It uses <page>ModelImage</page> internally.</description> </panel> <example> <description>Creates a DFrame with a SpawnIcon inside.</description> <code> local Panel = vgui.Create( "DFrame" ) -- Main Frame Panel:SetPos( 200, 200 ) Panel:SetSize( 200, 200 ) Panel:SetTitle( "Spawn Icon Test" ) Panel:SetVisible( true ) Panel:SetDraggable( false ) Panel:ShowCloseButton( true ) Panel:MakePopup() local SpawnI = vgui.Create( "SpawnIcon" , Panel ) -- SpawnIcon SpawnI:SetPos( 75, 75 ) SpawnI:SetModel( "models/props_borealis/bluebarrel001.mdl" ) -- Model we want for this spawn icon </code> </example>