English hudtxt: textwidth() & charwidth() icon

7 comments
03.12.17 02:57:31 pm
like 5 like it!
25 kb, 546 Downloads
SQ
Moderator
Offline Off
// 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
Code:
1
2
3
4
5
dofile("sys/lua/imageFont.lua")

imageFont.Load('sys/lua/font.dat')

print(textwidth("hello world"))
edited 12×, last 05.12.17 07:41:58 pm
ok This file has been reviewed and approved by Infinite Rain (03.12.17 03:55:45 pm)

Comments

7 comments
Goto Page
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in
13.04.21 02:03:14 am
Up
SQ
Moderator
Offline Off
@user novA2DOT: What you don't like about it?
13.04.21 12:11:07 am
Up
novA2DOT
User
Offline Off
bad script
12.04.21 10:54:24 pm
like I like it!
Up
cs2d_is_a_Gem
User
Offline Off
really good
14.12.17 12:12:12 pm
like I like it!
Up
Gaios
Reviewer
Offline Off
Finally cs2d cmd mp_hudscale 1 support.
14.12.17 10:46:28 am
like I like it!
Up
TobyInChina
User
Offline Off
good job
05.12.17 07:40:46 pm
like I like it!
Up
Infinite Rain
Reviewer
Offline Off
Thank you a lot for this.
03.12.17 03:02:11 pm
like I like it!
Up
Masea
Super User
Offline Off
Thank you
To the start Previous 1 Next To the start