A simple button API for ComputerCraft.
Creates a new button at the specified position and the specified size. The f
value is the function that will be ran when the button is pressed. By default, m
is 1. This can be changed by passing to the 6th argument.
Removes the specified id
from the list of buttons. This ID is returned when a button is created.
Checks for when a button is pressed. If you want to have other events in your program (e.g. key events), see button.checkEvents()
.
Checks for button events. Basically, goes through all buttons and checks if the values in e
are inside a button. e
should be {os.pullEvent()
. If you are only using mouse events from this API in your program, use button.eventLoop()