Make cube less intrusive and more correct

This commit is contained in:
Casey 2023-10-12 21:47:11 +03:00
parent 245c000532
commit 302c1bd4cc
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 3 additions and 1 deletions

View File

@ -14,12 +14,14 @@ return function()
if cache[id] == nil then if cache[id] == nil then
cache[id] = {} cache[id] = {}
cache[id].cube = canvas3d.addBox(0, 0, 0) cache[id].cube = canvas3d.addBox(0, 0, 0)
cache[id].cube.setScale(0.5, 0.5, 0.5)
cache[id].frame = canvas3d.addFrame({ 0, 0, 0 }) cache[id].frame = canvas3d.addFrame({ 0, 0, 0 })
cache[id].text = cache[id].frame.addText({ 0, 0 }, "") cache[id].text = cache[id].frame.addText({ 0, 0 }, "")
end end
cache[id].cube.setAlpha(0x20)
cache[id].cube.setDepthTested(false) cache[id].cube.setDepthTested(false)
cache[id].frame.setDepthTested(false) cache[id].frame.setDepthTested(false)
cache[id].cube.setPosition(entity.x, entity.y, entity.z) cache[id].cube.setPosition(entity.x - 0.25, entity.y - 0.25, entity.z - 0.25)
cache[id].frame.setPosition(entity.x, entity.y, entity.z) cache[id].frame.setPosition(entity.x, entity.y, entity.z)
cache[id].text.setAlpha(0xFF) cache[id].text.setAlpha(0xFF)
cache[id].text.setText(entity.name) cache[id].text.setText(entity.name)