r/ComputerCraft • ComputerCrafter • Oct 12 '26

Help with graphics

So i'm making an interface for a terminal. How do i make the available commands look different when hovered over and run a program when clicked?

4 Upvotes

5 comments sorted by

View all comments

Show parent comment

3

u/Budget-Specific-349 ComputerCrafter Oct 12 '26

Okay, how do i listen for clicks on certain areas?

3

u/9551-eletronics Computercraft graphics research Oct 12 '26

Comparisons. This just gives you a click positions, to check if its an area just do mathematical comparisons for a bounding box check, I usually make a helper function like this

https://github.com/9551-Dev/GuiH/blob/main/util.lua#L7

2

u/Mrmoo2andahafe Oct 12 '26

Do an if statement in your loop, have that if statement check if the event is the mouse click. Have if statements within that if statement for every position on the screen you would like to check, if it moves use variables to track where it is. If you need it to persist on restart have a text doc with the info. Edit: typo

1

u/Annual-Ad-6010 9d ago

Simply use Basalt.