1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Add option to give every object a nametag

or change the nametag text of players
This commit is contained in:
BlockMen 2015-11-20 23:46:33 +01:00
parent 19f73e4efc
commit 9eee3c3f46
9 changed files with 111 additions and 95 deletions

View file

@ -2544,6 +2544,19 @@ This is basically a reference to a C++ `ServerActiveObject`
* `set_properties(object property table)`
* `get_properties()`: returns object property table
* `is_player()`: returns true for players, false otherwise
* `get_nametag_attributes()`
* returns a table with the attributes of the nametag of an object
* {
color = {a=0..255, r=0..255, g=0..255, b=0..255},
text = "",
}
* `set_nametag_attributes(attributes)`
* sets the attributes of the nametag of an object
* `attributes`:
{
color = ColorSpec,
text = "My Nametag",
}
##### LuaEntitySAO-only (no-op for other objects)
* `setvelocity({x=num, y=num, z=num})`
@ -2644,17 +2657,6 @@ This is basically a reference to a C++ `ServerActiveObject`
* in first person view
* in third person view (max. values `{x=-10/10,y=-10,15,z=-5/5}`)
* `get_eye_offset()`: returns offset_first and offset_third
* `get_nametag_attributes()`
* returns a table with the attributes of the nametag of the player
* {
color = {a=0..255, r=0..255, g=0..255, b=0..255},
}
* `set_nametag_attributes(attributes)`
* sets the attributes of the nametag of the player
* `attributes`:
{
color = ColorSpec,
}
### `InvRef`
An `InvRef` is a reference to an inventory.
@ -3232,6 +3234,8 @@ Definition tables
automatic_face_movement_dir = 0.0,
-- ^ automatically set yaw to movement direction; offset in degrees; false to disable
backface_culling = true, -- false to disable backface_culling for model
nametag = "", -- by default empty, for players their name is shown if empty
nametag_color = <color>, -- sets color of nametag as ColorSpec
}
### Entity definition (`register_entity`)