This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
bigbaddevil6's profile picture

Specifying a certain box to remove(OpenPeripherals )

Started by bigbaddevil6, 06 April 2014 - 08:52 PM
bigbaddevil6 #1
Posted 06 April 2014 - 10:52 PM
I been working on a program for OpenPeripherals that added dynamic boxes that slide out and flow instead of just appearing on the screen. I was wondering if there is a good way of remove a specific box. For example:

sidebar = peripheral.wrap("left")
box = peripheral.wrap("left")
for i = 1, 70, 4 do
   sidebar.clear()
   sidebar.addBox(1, 9, i, 1, 0x0000FF, 1)
   sleep(0.001)
end
for i =1, 70, 4 do
	box.clear()
	box.addBox(1, 10, i, 20, 0xFFFFFF, 0.5)
end

I would like it for when the box gets drawn that it would not remove the whole thing and just the box.
Or should I take a different approach on the whole thing? Been doing a lot of Java stuff so I'm trying to get back to using this again. The reason I don't have them both draw it I want the sidebar to be completely opaque. Where as the box will be partially transparent.
Inumel #2
Posted 07 April 2014 - 01:18 AM
When you draw something using openperipherals it makes a table with all of its settings, so you can do

whateveryouwant =  sidebar.addBox(1, 9, i, 1, 0x0000FF, 1)
then do

whateveryouwant.delete()