Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cam = self.CreateLink("camera")
- local screen = self.CreateLink("screen")
- local button = self.CreateLink("button")
- local RES = 61
- local FOV = 90
- local picture = nil
- local x = 0
- local y = 0
- function Think()
- if not cam.Connected then return 1 end
- if not screen.Connected then return 1 end
- if not button.Connected then return 1 end
- if button.IsPressed() then
- picture = cam.Query(FOV, RES, RES)
- screen.Clear(Color(0, 0, 0, 0))
- x = 0
- y = 0
- return 5
- end
- if picture then
- local val = picture[x][y] or 0
- local col = Color(0, 0, 0, 255)
- if val > 0 then
- col = Color(255, 255, 255, 255)
- end
- screen.Draw(" ", x, y, Color(0,0,0,0), col)
- x = x + 1
- if x > RES then
- x = 0
- y = y + 1
- end
- if y > RES then
- picture = nil
- end
- return 0
- end
- return 0.25
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement