Advertisement
Guest User

aaaaaa

a guest
Dec 7th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. local buffer = require("doubleBuffering")
  2. local image = require("image")
  3.  
  4. --------------------------------------------------------------------------------
  5.  
  6. -- Load image from file and draw it to screen buffer
  7. --buffer.drawImage(1, 1, image.load("/MineOS/Pictures/Raspberry.pic"))
  8. -- Fill buffer with black color and transparency set to 0.6 to make image "darker"
  9. buffer.clear(0x0, 0.6)
  10.  
  11. -- Draw 10 rectangles filled with random color
  12. local x, y, xStep, yStep = 2, 2, 4, 2
  13. for i = 1, 10 do
  14. buffer.drawRectangle(x, y, 6, 3, math.random(0x0, 0xFFFFFF), 0x0, " ")
  15. x, y = x + xStep, y + yStep
  16. end
  17.  
  18. -- Draw yellow semi-pixel ellipse
  19. buffer.drawSemiPixelEllipse(22, 22, 10, 10, 0xFFDB40)
  20. -- Draw yellow semi-pixel line
  21. buffer.drawSemiPixelLine(2, 36, 35, 3, 0xFFFFFF)
  22. -- Draw green bezier curve with accuracy set to 0.01
  23. buffer.drawSemiPixelCurve(
  24. {
  25. { x = 2, y = 63},
  26. { x = 63, y = 63},
  27. { x = 63, y = 2}
  28. },
  29. 0x44FF44,
  30. 0.01
  31. )
  32.  
  33. buffer.drawChanges()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement