Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local gpu = component.gpu
- local baseLib = {}
- local id = 1
- baseLib.getId = function()
- id = id + 1
- return id - 1
- end
- --Возвращает индекс пикселя в буфере по координатам, кол-ву переменных, принадлежащих 1 пикселю, и ширине буфера
- baseLib.getIndexByCoords = function(x, y, numberItems, width)
- width = width or gpu.getResolution()
- numberItems = numberItems or 1
- return (y * width - width + x) * numberItems - numberItems
- end
- return baseLib
Advertisement
Add Comment
Please, Sign In to add comment