Silkicons

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
  
 
A full list of all silkicons which can be used in the game can be [http://www.famfamfam.com/lab/icons/silk/previews/index_abc.png viewed here] or with search feature [http://www.famfamfam.com/lab/icons/silk/preview.php here]
 
A full list of all silkicons which can be used in the game can be [http://www.famfamfam.com/lab/icons/silk/previews/index_abc.png viewed here] or with search feature [http://www.famfamfam.com/lab/icons/silk/preview.php here]
 +
 +
Also included are flag icons. They can be found in materials/flag16/*.ping
 +
 +
The flag icon filenames follow the [https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 ISO 3166-1 alpha-2 country codes.] and include all flags
  
 
=Example of using silkicons=
 
=Example of using silkicons=

Revision as of 23:07, 21 June 2017

In Garry's Mod 13, all silkicons are included in the game. They can be found in materials/icon16/*.png

A full list of all silkicons which can be used in the game can be viewed here or with search feature here

Also included are flag icons. They can be found in materials/flag16/*.ping

The flag icon filenames follow the ISO 3166-1 alpha-2 country codes. and include all flags

Example of using silkicons

This line of code makes a DermaMenu option have a silkicon logo on its left side.

MENU:AddOption("Say hi", function() RunConsoleCommand("say", "hi") end ):SetImage( "icon16/user.png" )

Rendering silkicons

You no longer can use surface.GetTextureID and surface.SetTexture with silkicons, because they are now .png files. Now, to draw them, you must use Material and surface.SetMaterial. Since Material is slower than surface.GetTextureID, it is not recommended to call it in a drawing hook, which are ran every frame, as that will cause lag. Instead, save the material as a variable outside of the draw hook.

Personal tools
Navigation