openWindow.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. return {
  2. tag = 'system-window',
  3. summary = 'Open the desktop window.',
  4. description = [[
  5. Opens the desktop window. If the window is already open, this function does nothing.
  6. ]],
  7. arguments = {
  8. options = {
  9. type = 'table',
  10. description = 'Window options.',
  11. table = {
  12. {
  13. name = 'width',
  14. type = 'number',
  15. default = '720',
  16. description = 'The width of the window, or 0 to use the width of the monitor.'
  17. },
  18. {
  19. name = 'height',
  20. type = 'number',
  21. default = '800',
  22. description = 'The height of the window, or 0 to use the height of the monitor.'
  23. },
  24. {
  25. name = 'fullscreen',
  26. type = 'boolean',
  27. description = 'Whether the window should be fullscreen.'
  28. },
  29. {
  30. name = 'resizable',
  31. type = 'boolean',
  32. description = 'Whether the window should be resizable.'
  33. },
  34. {
  35. name = 'title',
  36. type = 'string',
  37. description = 'The window title.'
  38. },
  39. {
  40. name = 'icon',
  41. type = 'string',
  42. description = 'An `Image` or path to an image file to use for the window icon.'
  43. }
  44. }
  45. }
  46. },
  47. returns = {},
  48. variants = {
  49. {
  50. arguments = { 'options' },
  51. returns = {}
  52. }
  53. },
  54. notes = [[
  55. By default, the window is opened automatically, but this can be disabled by setting `t.window`
  56. to `nil` in `conf.lua`.
  57. ]],
  58. related = {
  59. 'lovr.system.isWindowOpen',
  60. 'lovr.conf'
  61. }
  62. }