Closed Shazuli closed 6 years ago
well... this should work now ;)
component = require("component")
event = require("event")
glasses = component.glasses
glasses.removeAll()
local box = glasses.addRect()
box.setSize(10,10)
box.setColor(1,1,1)
box.setAlpha(0.8)
function clickEvent(id, device, user, x, y, button, maxX, maxY)
fX = x * (512 / maxX)
fY = y * (288 / maxY)
box.setPosition(fX, fY)
print(fX, fY)
end
event.listen("interact_overlay", clickEvent)
event.pull("interrupted")
event.ignore("interact_overlay", clickEvent)
Fixed
Hi!
I've been working on a button API for your mod OpenGlasses in latest (OpenGlasses-MC1.12.1-1.5.4) version of it. I was done with the graphics, so I was going to add functionality to the buttons now. So I made a event test for click on the screen. Seems to be working fine but I noticed when I had a small square to be placed on the
x
andy
values that it was incorrect. The higher up I went on the axis the more off it was. At0,0
it was right on spot, but the more the values grew the more off they were. I made a small gif to show the effect. GifScript: