Files

> > CS2D > Lua Scripts > Custom Number hud
Files overviewCS2D overviewLua Scripts overview

English Custom Number hud >

16 comments99 kb, 445 Downloads

old Custom Number hud

MikuAuahDark
User Off Offline

Custom Number hud by MikuAuahDark

∗ Description ∗
This Lua allows you to add custom hud that displays number.

∗ Installation ∗
The installation method for this file is unusual. Try to extract cn.lua and dofile cn_example.lua only in sys/lua to see the example.
Open cn_example.lua to see how the code is binded.
If you still can't understand how to use this lua, PM me.

∗ Used Global Variable ∗
> CustomNumber

∗ Functions List ∗
Please see https://github.com/MikuAuahDark/2dCustomNumberLua/wiki/Function-list.

∗ Files ∗
There's 3 scripts in the archive.
> cn.lua - The core functionality.
> cn_sif.lua - Example code how to add your own custom number hud. You also can use this code in your server if you want.
> cn_example.lua - Example code how it works. Displays time in seconds how long the server has been running in red big number.

∗ Notes ∗
1. CustomNumber.Update is expensive call because it deletes and add images everytime it's called. But there's no noticed lag in b0.1.2.6 (LuaJIT Power)
2. The berhaviour of this script if the number is overflowed is undefined.
3. The gfx/combonumber/ contains all image used for cn_sif.lua

∗ Version History ∗
>> v1.0
>
INFO
Initial commit.
edited 2×, last 12.12.15 06:49:18 am
Approved by Infinite Rain

Download Download

99 kb, 445 Downloads

Comments

16 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

MikuAuahDark
User Off Offline

@user Infinite Rain: No, there's no config to change the number color. It's all separated image.

Because everything is a separated image, you can create your own custom number hud by making digit 0 to 9 as image (the image size should be consistent) then create your own custom number hud.

old

Nekomata
User Off Offline

Useful!
I like it!

old

Infinite Rain
Reviewer Off Offline

Would making the number images white and making a configurable color in config work?
I like it!

old

Mami Tomoe
User Off Offline

looks good for zombie plague or something
I like it!

old

Cure Pikachu
User Off Offline

@user DaisukeOno: Yeah, what exactly can't you open? The ZIP file itself or its contents?

@File: Interesting, might be useful for something.
I like it!

old

MikuAuahDark
User Off Offline

What do you mean you can't open the file? does it shows error or something?

old

DaisukeOno
User Off Offline

Why i can't open these files ?

old

MikuAuahDark
User Off Offline

@user Avo: Actually there's 90 images in the archive. (It uses 0-based indexing).
@user Gaios: Lol, the rest of the image is actually for people that doesn't know how to add their custom number hud. So instead of creating it from stratch, I already created 9 pre-defined custom hud number which can be used by passing combonumber_[1-9] in the name parameter. dofile sys/lua/cn_sif.lua before using.
@user VADemon: I don't understand. PNG files are compressed already.

I guess I should upload more screenshots.

old

VADemon
User Off Offline

That's fancy! Though some servers use so many HUD elements that they begin to look shitty again.

Btw: do you want the compressed version of PNGs? That's 72kB.
I like it!

old

Rainoth
Moderator Off Offline

If you guys actually bothered to check, the images are different.
So I guess it does utilize the system of using single digit images all the time but the style/color of the digits changes.

It's an okay file.

old

Avo
User Off Offline

There are 89 files and most of them have size of 2kb or less what gives less than 178kb. I can't see any use for it actually, but they look pretty neat. Good job.
I like it!

old

Gaios
Reviewer Off Offline

Let's download 89 images instead of 10.

old

MikuAuahDark
User Off Offline

@user Yates: it will show 6.png and 4.png

There's actually 9 custom number hud defined in cn_sif.lua. You may want to take a look that file to see the reason why there's file named like 032.png.

old

Yates
Reviewer Off Offline

Wait why are there numbers above 9 in the .zip?

When I want to show 64, does it show 64.png or 6.png and 4.png?

old

Ridho
User Off Offline

I'm waiting for this
I like it!
To the start Previous 1 Next To the start