mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add gfx.text3d OOP wrapper
This commit is contained in:
parent
4a74e56eda
commit
3a1e90f517
3 changed files with 26 additions and 3 deletions
13
res/scripts/hud_classes.lua
Normal file
13
res/scripts/hud_classes.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
local Text3D = {__index={
|
||||
hide=function(self) return gfx.text3d.hide(self.id) end,
|
||||
get_pos=function(self) return gfx.text3d.get_pos(self.id) end,
|
||||
set_pos=function(self, v) return gfx.text3d.set_pos(self.id, v) end,
|
||||
get_text=function(self) return gfx.text3d.get_text(self.id) end,
|
||||
set_text=function(self, s) return gfx.text3d.set_text(self.id, s) end,
|
||||
update_settings=function(self, t) return gfx.text3d.update_settings(self.id, t) end,
|
||||
}}
|
||||
|
||||
gfx.text3d.new = function(pos, text, preset, extension)
|
||||
local id = gfx.text3d.show(pos, text, preset, extension)
|
||||
return setmetatable({id=id}, Text3D)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue