Garry's Mod

Garry's Mod

评价数不足
Keyboard-Glyphs
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 服务器内容
文件大小
发表于
更新日期
362.021 KB
11 月 23 日 下午 11:37
11 月 24 日 上午 2:58
2 项改动说明 ( 查看 )

订阅以下载
Keyboard-Glyphs

描述
This Addon allowes Developers to use same keyboard glyphs in their addons, that can be found in games like Hunt: Showdown, Slay the Spire and many other titles.

best practice is to use GetGlyphForBind(binding, backup) and GetGlyphForKeyCode(code, backup) for your glyphs, they however only return the lightglyphs right now.

alternatively, you may use the global table GLOBAL_KEYBOARDGLYPHS to retrive your images.
use: GLOBAL_KEYBOARDGLYPHS[keycode].lightglyph or GLOBAL_KEYBOARDGLYPHS[keycode].darkglyph

example:

-- draws the glyph for the "forward" key of the player, default "w"
panel.Paint = function(s, w, h)
surface.SetDrawColor( Color(255, 255, 255, 255) )
surface.SetMaterial( Material (GetGlyphForBind("+forward","not binded")), "noclamp smooth") )
surface.DrawTexturedRect( 0 , 0 , w , h )
end

All the Materials are by Nicolae (Xelu) Berbece and in the public domain under Creative Commons 0 (CC0)