2
0
bjorn 4 сар өмнө
parent
commit
786a835fe8

+ 4 - 3
api/init.lua

@@ -15011,9 +15011,10 @@ return {
             {
             {
               name = "getLines",
               name = "getLines",
               summary = "Wrap a string into a sequence of lines.",
               summary = "Wrap a string into a sequence of lines.",
-              description = "Returns a table of wrapped lines for a piece of text, given a line length limit.  Newlines are handled correctly.  The wrap limit units depend on the pixel density of the font.  With the default pixel density, the units correspond to meters when the font is drawn at 1.0 scale.",
+              description = "Returns a table of wrapped lines for a piece of text, given a line length limit.\n\nBy default the units for `limit` are in meters.  If text is being drawn with scale applied, make sure the scale is also applied to the `limit`.",
               key = "Font:getLines",
               key = "Font:getLines",
               module = "lovr.graphics",
               module = "lovr.graphics",
+              notes = "The font's pixel density is incorporated into the limit.  So if the font's pixel density is changed to 1 (changing the font's units to pixels), the `limit` will be in pixels as well.",
               related = {
               related = {
                 "Font:getWidth",
                 "Font:getWidth",
                 "Font:getHeight",
                 "Font:getHeight",
@@ -15037,7 +15038,7 @@ return {
                     {
                     {
                       name = "lines",
                       name = "lines",
                       type = "table",
                       type = "table",
-                      description = "A table strings, one for each wrapped line (without any color information)."
+                      description = "A table of strings, one for each wrapped line."
                     }
                     }
                   }
                   }
                 },
                 },
@@ -15058,7 +15059,7 @@ return {
                     {
                     {
                       name = "lines",
                       name = "lines",
                       type = "table",
                       type = "table",
-                      description = "A table strings, one for each wrapped line (without any color information)."
+                      description = "A table of strings, one for each wrapped line."
                     }
                     }
                   }
                   }
                 }
                 }

+ 9 - 4
api/lovr/graphics/Font/getLines.lua

@@ -1,9 +1,10 @@
 return {
 return {
   summary = 'Wrap a string into a sequence of lines.',
   summary = 'Wrap a string into a sequence of lines.',
   description = [[
   description = [[
-    Returns a table of wrapped lines for a piece of text, given a line length limit.  Newlines are
-    handled correctly.  The wrap limit units depend on the pixel density of the font.  With the
-    default pixel density, the units correspond to meters when the font is drawn at 1.0 scale.
+    Returns a table of wrapped lines for a piece of text, given a line length limit.
+
+    By default the units for `limit` are in meters.  If text is being drawn with scale applied, make
+    sure the scale is also applied to the `limit`.
   ]],
   ]],
   arguments = {
   arguments = {
     string = {
     string = {
@@ -25,7 +26,7 @@ return {
   returns = {
   returns = {
     lines = {
     lines = {
       type = 'table',
       type = 'table',
-      description = 'A table strings, one for each wrapped line (without any color information).'
+      description = 'A table of strings, one for each wrapped line.'
     }
     }
   },
   },
   variants = {
   variants = {
@@ -38,6 +39,10 @@ return {
       returns = { 'lines' }
       returns = { 'lines' }
     }
     }
   },
   },
+  notes = [[
+    The font's pixel density is incorporated into the limit.  So if the font's pixel density is
+    changed to 1 (changing the font's units to pixels), the `limit` will be in pixels as well.
+  ]],
   related = {
   related = {
     'Font:getWidth',
     'Font:getWidth',
     'Font:getHeight',
     'Font:getHeight',