Files

> > CS2D > Lua Scripts > hudtxt: textwidth() & charwidth()
Files overviewCS2D overviewLua Scripts overview

English hudtxt: textwidth() & charwidth() >

7 comments25 kb, 570 Downloads

old hudtxt: textwidth() & charwidth()

SQ
Moderator Off Offline

// 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
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
Approved by Infinite Rain

Download Download

25 kb, 570 Downloads

Comments

7 comments
To the start Previous 1 Next To the start

Log in!

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

old

SQ
Moderator Off Offline

@user novA2DOT: What you don't like about it?

old

novA2DOT
User Off Offline

bad script

old

TobyInChina
User Off Offline

good job
I like it!

old

Infinite Rain
Reviewer Off Offline

Thank you a lot for this.
I like it!

old

Masea
Super User Off Offline

Thank you
I like it!
To the start Previous 1 Next To the start