hudtxt: textwidth() & charwidth() 
7 comments // Version 1.0 2017/12/03
// Description
Using this library you are able to get string width. Handy for the scripts that are using hudtxt command!
// Notes
Recommended for "mp_hudscale 0" and "mp_hudscale 3"
It works with 1, 2 modes as well.
This works only with default font
// Functions
imageFont.Load( path ) -- used only once
textwidth ( string, size = 13 )
charwidth ( char, size = 13 )
// Sample
// Description
Using this library you are able to get string width. Handy for the scripts that are using hudtxt command!
// Notes



// Functions



// Sample
Code:
1
2
3
4
5
2
3
4
5
dofile("sys/lua/imageFont.lua")
imageFont.Load('sys/lua/font.dat')
print(textwidth("hello world"))
imageFont.Load('sys/lua/font.dat')
print(textwidth("hello world"))
edited 12×, last 05.12.17 07:41:58 pm

Comments
7 comments



Log in!
You need to log in to be able to write comments!Log in



