mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 15:01:49 +00:00
add gfx.text3d.get_entity, set_entity
This commit is contained in:
parent
dc29f65fa8
commit
6426fff26e
1 changed files with 16 additions and 0 deletions
|
|
@ -95,6 +95,20 @@ static int l_set_rotation(lua::State* L) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int l_get_entity(lua::State* L) {
|
||||||
|
if (auto note = renderer->texts->get(lua::tointeger(L, 1))) {
|
||||||
|
return lua::pushinteger(L, note->getEntity());
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int l_set_entity(lua::State* L) {
|
||||||
|
if (auto note = renderer->texts->get(lua::tointeger(L, 1))) {
|
||||||
|
note->setEntity(lua::touinteger(L, 2));
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const luaL_Reg text3dlib[] = {
|
const luaL_Reg text3dlib[] = {
|
||||||
{"show", wrap_hud<l_show>},
|
{"show", wrap_hud<l_show>},
|
||||||
{"hide", wrap_hud<l_hide>},
|
{"hide", wrap_hud<l_hide>},
|
||||||
|
|
@ -108,5 +122,7 @@ const luaL_Reg text3dlib[] = {
|
||||||
{"set_axis_y", wrap_hud<l_set_axis_y>},
|
{"set_axis_y", wrap_hud<l_set_axis_y>},
|
||||||
{"set_rotation", wrap_hud<l_set_rotation>},
|
{"set_rotation", wrap_hud<l_set_rotation>},
|
||||||
{"update_settings", wrap_hud<l_update_settings>},
|
{"update_settings", wrap_hud<l_update_settings>},
|
||||||
|
{"get_entity", wrap_hud<l_get_entity>},
|
||||||
|
{"set_entity", wrap_hud<l_set_entity>},
|
||||||
{nullptr, nullptr}
|
{nullptr, nullptr}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue