getPixelDensity.lua 765 B

123456789101112131415161718192021222324252627
  1. return {
  2. tag = 'window',
  3. summary = 'Get the pixel density of the window.',
  4. description = [[
  5. Returns the pixel density of the window. On "high-dpi" displays, this will be `2.0`, indicating
  6. that there are 2 pixels for every window coordinate. On a normal display it will be `1.0`,
  7. meaning that the pixel to window-coordinate ratio is 1:1.
  8. ]],
  9. arguments = {},
  10. returns = {
  11. {
  12. name = 'density',
  13. type = 'number',
  14. description = 'The pixel density of the window.'
  15. }
  16. },
  17. notes = [[
  18. If the window isn't created yet, this function will return 0.
  19. ]],
  20. related = {
  21. 'lovr.graphics.getWidth',
  22. 'lovr.graphics.getHeight',
  23. 'lovr.graphics.getDimensions',
  24. 'lovr.graphics.createWindow',
  25. 'lovr.conf'
  26. }
  27. }