AR Clear/Override Specific Elements
ThatGravyBoat opened this issue ยท 1 comments
Describe your idea
Ability to clear specific elements from the AR Glasses rather than the whole canvas, you can possibly store the canvas as a map of Strings to ARRenderAction instead of a list and then you can maybe do this for example in a script
local controller = peripheral.find('arController')
local detector = peripheral.find("environmentDetector")
controller.drawItemIcon("minecraft:clock", 4, 4)
while true do
local timeseconds = math.floor((detector.getTime() % 24000) / 20)
local endTime
local endTimeNum = math.floor(60*((timeseconds / 60) % 1))
if endTimeNum < 10 then
endTime = "0" .. tostring(endTimeNum)
else
endTime = tostring(endTimeNum)
end
controller.clearElement("clock_text")
controller.drawStringWithId("clock_text", tostring(math.floor(timeseconds / 60)) .. ":" .. endTime, 20, 8, 16777215)
os.sleep(0.25)
end
there is one thing about the script above and that is if its a map the drawStringWithId should override the previous one with the same id so that things such as the script I gave in my example would make it so none of it flickers, the clear specific element is so that it doesn't clear the clock when I clear the text but if drawStringWithId overrides the previous one the clear wouldn't be needed in that script but it could be useful for other things.
Describe alternatives you've considered if you've any
No response
Additional context
No response
Linked Issues
No response