3d_room.py 824 B

12345678910111213141516171819202122232425262728293031
  1. from lazpaint import tools, image, layer, dialog
  2. def line(x, y, x2, y2):
  3. tools.choose(tools.PEN)
  4. tools.mouse([(x, y), (x2, y2)])
  5. ZOOM = dialog.input_value("Zoom (Between 0.1 and 0.4 it creates a 3d room, more than 0.5 to 0.9 it creates a cross with a rectangle)", 0.25)
  6. image.do_begin()
  7. layer.new()
  8. w = image.get_width()
  9. h = image.get_height()
  10. #top left
  11. line(0, 0, w * ZOOM, h * ZOOM)
  12. #bottom left
  13. line(0, h, w * ZOOM, h - (h * ZOOM))
  14. #top right
  15. line(w, 0, w - (w * ZOOM), h * ZOOM)
  16. #bottom right
  17. line(w, h, w - (w * ZOOM), h - (h * ZOOM))
  18. #top
  19. line(w * ZOOM, h * ZOOM, w - (w * ZOOM), h * ZOOM)
  20. #bottom
  21. line(w * ZOOM, h - (h * ZOOM), w - (w * ZOOM), h - (h * ZOOM))
  22. #left
  23. line(w * ZOOM, h * ZOOM, w * ZOOM, h - (h * ZOOM))
  24. #right
  25. line(w - (w * ZOOM), h - (h * ZOOM), w - (w * ZOOM), h * ZOOM)
  26. image.do_end()