Advertisement
HappySunChild

Draw-OpenComputers

Aug 7th, 2022
939
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local component = require("component")
  2. local vector2 = require("vector2")
  3. local color3 = require("color3")
  4. local draw = require("draw")
  5. local event = require("event")
  6. local gpu = component.gpu
  7.  
  8. local w,h = gpu.getResolution()
  9. local mh,mw = h/2, w/2
  10.  
  11. local center = vector2.new(mw,mh)
  12.  
  13. local lastTouch = center
  14.  
  15. -- shell
  16.  
  17. while true do
  18.   local _,_,x,y = event.pull("touch")
  19.  
  20.   local touch = vector2.new(x,y)
  21.   draw.line(touch,lastTouch,color3.fromRGB(255,255,255))
  22.  
  23.   lastTouch = touch
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement