bjorn 3 days ago
parent
commit
e093d39e9d
43 changed files with 299 additions and 1012 deletions
  1. 89 562
      api/init.lua
  2. 4 4
      api/lovr/audio/getDevice.lua
  3. 3 7
      api/lovr/audio/newSource.lua
  4. 2 1
      api/lovr/data/Blob/getName.lua
  5. 3 1
      api/lovr/data/Image/encode.lua
  6. 5 13
      api/lovr/data/ModelData/getAnimationChannelCount.lua
  7. 4 12
      api/lovr/data/ModelData/getAnimationDuration.lua
  8. 13 12
      api/lovr/data/ModelData/getAnimationKeyframe.lua
  9. 4 12
      api/lovr/data/ModelData/getAnimationKeyframeCount.lua
  10. 3 4
      api/lovr/data/ModelData/getAnimationName.lua
  11. 4 12
      api/lovr/data/ModelData/getAnimationNode.lua
  12. 5 13
      api/lovr/data/ModelData/getAnimationProperty.lua
  13. 3 11
      api/lovr/data/ModelData/getAnimationSmoothMode.lua
  14. 14 23
      api/lovr/data/ModelData/getMaterial.lua
  15. 6 15
      api/lovr/data/ModelData/getNodeChildren.lua
  16. 4 12
      api/lovr/data/ModelData/getNodeMeshes.lua
  17. 4 12
      api/lovr/data/ModelData/getNodeOrientation.lua
  18. 5 13
      api/lovr/data/ModelData/getNodeParent.lua
  19. 4 12
      api/lovr/data/ModelData/getNodePose.lua
  20. 4 12
      api/lovr/data/ModelData/getNodePosition.lua
  21. 4 12
      api/lovr/data/ModelData/getNodeScale.lua
  22. 4 12
      api/lovr/data/ModelData/getNodeSkin.lua
  23. 4 12
      api/lovr/data/ModelData/getNodeTransform.lua
  24. 0 1
      api/lovr/data/ModelData/getSkinCount.lua
  25. 1 0
      api/lovr/data/ModelData/getSkinJoints.lua
  26. 11 13
      api/lovr/data/Rasterizer/getAdvance.lua
  27. 11 13
      api/lovr/data/Rasterizer/getBearing.lua
  28. 6 12
      api/lovr/data/Rasterizer/getBoundingBox.lua
  29. 4 12
      api/lovr/data/Rasterizer/getCurves.lua
  30. 6 12
      api/lovr/data/Rasterizer/getDimensions.lua
  31. 1 1
      api/lovr/data/Rasterizer/getFontSize.lua
  32. 5 13
      api/lovr/data/Rasterizer/getHeight.lua
  33. 4 25
      api/lovr/data/Rasterizer/getKerning.lua
  34. 5 13
      api/lovr/data/Rasterizer/getWidth.lua
  35. 13 2
      api/lovr/data/Rasterizer/hasGlyphs.lua
  36. 4 12
      api/lovr/data/Rasterizer/newImage.lua
  37. 1 1
      api/lovr/data/Sound/getFrames.lua
  38. 4 20
      api/lovr/data/Sound/setFrames.lua
  39. 6 15
      api/lovr/data/newImage.lua
  40. 4 12
      api/lovr/data/newModelData.lua
  41. 6 14
      api/lovr/data/newRasterizer.lua
  42. 10 20
      api/lovr/data/newSound.lua
  43. 2 2
      api/lovr/graphics/Model/getAnimationName.lua

File diff suppressed because it is too large
+ 89 - 562
api/init.lua


+ 4 - 4
api/lovr/audio/getDevice.lua

@@ -11,12 +11,12 @@ return {
   },
   },
   returns = {
   returns = {
     name = {
     name = {
-      type = 'string',
-      description = 'The name of the device.'
+      type = 'string | nil',
+      description = 'The name of the device, or `nil` if no device is set.'
     },
     },
     id = {
     id = {
-      type = 'userdata',
-      description = 'The opaque id of the device.'
+      type = 'userdata | nil',
+      description = 'The opaque id of the device, or `nil` if no device is set.'
     }
     }
   },
   },
   variants = {
   variants = {

+ 3 - 7
api/lovr/audio/newSource.lua

@@ -3,13 +3,9 @@ return {
   summary = 'Create a new Source.',
   summary = 'Create a new Source.',
   description = 'Creates a new Source from an ogg, wav, or mp3 file.',
   description = 'Creates a new Source from an ogg, wav, or mp3 file.',
   arguments = {
   arguments = {
-    filename = {
-      type = 'string',
-      description = 'The filename of the sound to load.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'The Blob containing the Source data.'
+    file = {
+      type = 'string | Blob',
+      description = 'A filename or Blob containing audio data to load.'
     },
     },
     sound = {
     sound = {
       type = 'Sound',
       type = 'Sound',

+ 2 - 1
api/lovr/data/Blob/getName.lua

@@ -16,5 +16,6 @@ return {
       arguments = {},
       arguments = {},
       returns = { 'name' }
       returns = { 'name' }
     }
     }
-  }
+  },
+  notes = 'If a Blob was created without a name, its name will default to the empty string.'
 }
 }

+ 3 - 1
api/lovr/data/Image/encode.lua

@@ -1,6 +1,8 @@
 return {
 return {
   summary = 'Encode the Image as png.',
   summary = 'Encode the Image as png.',
-  description = 'Encodes the Image to an uncompressed png.  This intended mainly for debugging.',
+  description = [[
+    Encodes the Image to an **uncompressed** png.  This intended mainly for debugging.
+  ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
     blob = {
     blob = {

+ 5 - 13
api/lovr/data/ModelData/getAnimationChannelCount.lua

@@ -3,16 +3,12 @@ return {
   description = [[
   description = [[
     Returns the number of channels in an animation.
     Returns the number of channels in an animation.
 
 
-    A channel is a set of keyframes for a single property of a node.
+    A channel is a set of keyframes targeting a single property of a node.
   ]],
   ]],
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of an animation.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of an animation.'
+    animation = {
+      type = 'number | string',
+      description = 'The name or index of an animation.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -23,11 +19,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'count' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'animation' },
       returns = { 'count' }
       returns = { 'count' }
     }
     }
   },
   },

+ 4 - 12
api/lovr/data/ModelData/getAnimationDuration.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get the duration of an animation.',
   summary = 'Get the duration of an animation.',
   description = 'Returns the duration of an animation.',
   description = 'Returns the duration of an animation.',
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the animation.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the animation.'
+    animation = {
+      type = 'string | number',
+      description = 'The name or index of an animation.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -19,11 +15,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'duration' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'animation' },
       returns = { 'duration' }
       returns = { 'duration' }
     }
     }
   },
   },

+ 13 - 12
api/lovr/data/ModelData/getAnimationKeyframe.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get a keyframe in a channel of an animation.',
   summary = 'Get a keyframe in a channel of an animation.',
   description = 'Returns a single keyframe in a channel of an animation.',
   description = 'Returns a single keyframe in a channel of an animation.',
   arguments = {
   arguments = {
-    index = {
+    animation = {
       type = 'number',
       type = 'number',
-      description = 'The index of an animation.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of an animation.'
+      description = 'The name or index of an animation.'
     },
     },
     channel = {
     channel = {
       type = 'number',
       type = 'number',
@@ -26,19 +22,24 @@ return {
     },
     },
     ['...'] = {
     ['...'] = {
       type = 'number',
       type = 'number',
-      description = 'The data for the keyframe (either 3 or 4 numbers depending on the property).'
+      description = 'The data for the keyframe (3 or more numbers, depending on the property).'
     }
     }
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index', 'channel', 'keyframe' },
-      returns = { 'time', '...' }
-    },
-    {
-      arguments = { 'name', 'channel', 'keyframe' },
+      arguments = { 'animation', 'channel', 'keyframe' },
       returns = { 'time', '...' }
       returns = { 'time', '...' }
     }
     }
   },
   },
+  notes = [[
+    The number of values returned after `time` depends on the `AnimationProperty` targeted by the
+    channel:
+
+    - `translation`: 3 numbers
+    - `rotation`: 4 numbers (returned as raw quaternion components)
+    - `scale`: 3 numbers
+    - `weights`: variable, contains 1 number for each blend shape in the node
+  ]],
   related = {
   related = {
     'ModelData:getAnimationSmoothMode',
     'ModelData:getAnimationSmoothMode',
     'ModelData:getAnimationKeyframeCount'
     'ModelData:getAnimationKeyframeCount'

+ 4 - 12
api/lovr/data/ModelData/getAnimationKeyframeCount.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get the number of keyframes in a channel of an animation.',
   summary = 'Get the number of keyframes in a channel of an animation.',
   description = 'Returns the number of keyframes in a channel of an animation.',
   description = 'Returns the number of keyframes in a channel of an animation.',
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of an animation.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of an animation.'
+    animation = {
+      type = 'string | number',
+      description = 'The name or index of an animation.'
     },
     },
     channel = {
     channel = {
       type = 'number',
       type = 'number',
@@ -23,11 +19,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index', 'channel' },
-      returns = { 'count' }
-    },
-    {
-      arguments = { 'name', 'channel' },
+      arguments = { 'animation', 'channel' },
       returns = { 'count' }
       returns = { 'count' }
     }
     }
   },
   },

+ 3 - 4
api/lovr/data/ModelData/getAnimationName.lua

@@ -4,13 +4,13 @@ return {
   arguments = {
   arguments = {
     index = {
     index = {
       type = 'number',
       type = 'number',
-      description = 'The index of the animation.'
+      description = 'The index of an animation.'
     }
     }
   },
   },
   returns = {
   returns = {
     name = {
     name = {
-      type = 'string',
-      description = 'The name of the animation.'
+      type = 'string | nil',
+      description = 'The name of the animation, or `nil` if the animation doesn\'t have a name.'
     }
     }
   },
   },
   variants = {
   variants = {
@@ -19,7 +19,6 @@ return {
       returns = { 'name' }
       returns = { 'name' }
     }
     }
   },
   },
-  notes = 'If the animation does not have a name, this function returns `nil`.',
   related = {
   related = {
     'Model:getAnimationName'
     'Model:getAnimationName'
   }
   }

+ 4 - 12
api/lovr/data/ModelData/getAnimationNode.lua

@@ -1,14 +1,10 @@
 return {
 return {
   summary = 'Get the node targeted by the channel of an animation.',
   summary = 'Get the node targeted by the channel of an animation.',
-  description = 'Returns the index of a node targeted by an animation\'s channel.',
+  description = 'Returns the index of the node targeted by an animation\'s channel.',
   arguments = {
   arguments = {
-    index = {
+    animation = {
       type = 'number',
       type = 'number',
-      description = 'The index of an animation.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of an animation.'
+      description = 'The index or name of an animation.'
     },
     },
     channel = {
     channel = {
       type = 'number',
       type = 'number',
@@ -23,11 +19,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index', 'channel' },
-      returns = { 'node' }
-    },
-    {
-      arguments = { 'name', 'channel' },
+      arguments = { 'animation', 'channel' },
       returns = { 'node' }
       returns = { 'node' }
     }
     }
   },
   },

+ 5 - 13
api/lovr/data/ModelData/getAnimationProperty.lua

@@ -1,14 +1,10 @@
 return {
 return {
-  summary = 'Get the property targeted by the channel of an animation.',
+  summary = 'Get the property targeted by a channel of an animation.',
   description = 'Returns the property targeted by an animation\'s channel.',
   description = 'Returns the property targeted by an animation\'s channel.',
   arguments = {
   arguments = {
     index = {
     index = {
-      type = 'number',
-      description = 'The index of an animation.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of an animation.'
+      type = 'string | number',
+      description = 'The name or index of an animation.'
     },
     },
     channel = {
     channel = {
       type = 'number',
       type = 'number',
@@ -19,17 +15,13 @@ return {
     property = {
     property = {
       type = 'AnimationProperty',
       type = 'AnimationProperty',
       description = [[
       description = [[
-        The property (translation, rotation, scale, weights) affected by the keyframes.
+        The property (translation, rotation, scale, or weights) affected by the keyframes.
       ]]
       ]]
     }
     }
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index', 'channel' },
-      returns = { 'property' }
-    },
-    {
-      arguments = { 'name', 'channel' },
+      arguments = { 'animation', 'channel' },
       returns = { 'property' }
       returns = { 'property' }
     }
     }
   },
   },

+ 3 - 11
api/lovr/data/ModelData/getAnimationSmoothMode.lua

@@ -3,12 +3,8 @@ return {
   description = 'Returns the smooth mode of a channel in an animation.',
   description = 'Returns the smooth mode of a channel in an animation.',
   arguments = {
   arguments = {
     index = {
     index = {
-      type = 'number',
-      description = 'The index of an animation.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of an animation.'
+      type = 'string | number',
+      description = 'The name or index of an animation.'
     },
     },
     channel = {
     channel = {
       type = 'number',
       type = 'number',
@@ -23,11 +19,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index', 'channel' },
-      returns = { 'smooth' }
-    },
-    {
-      arguments = { 'name', 'channel' },
+      arguments = { 'animation', 'channel' },
       returns = { 'smooth' }
       returns = { 'smooth' }
     }
     }
   },
   },

+ 14 - 23
api/lovr/data/ModelData/getMaterial.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get the material properties for a material in the model.',
   summary = 'Get the material properties for a material in the model.',
   description = 'Returns a table with all of the properties of a material.',
   description = 'Returns a table with all of the properties of a material.',
   arguments = {
   arguments = {
-    index = {
+    material = {
       type = 'number',
       type = 'number',
-      description = 'The index of a material.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of a material.'
+      description = 'The name or index of a material.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -18,7 +14,7 @@ return {
       table = {
       table = {
         {
         {
           name = 'color',
           name = 'color',
-          type = 'table',
+          type = '{number}',
           description = [[
           description = [[
             The color of the material.  The table contains the `r`, `g`, `b`, and `a` components of the color,
             The color of the material.  The table contains the `r`, `g`, `b`, and `a` components of the color,
             from 0 to 1.
             from 0 to 1.
@@ -26,7 +22,7 @@ return {
         },
         },
         {
         {
           name = 'glow',
           name = 'glow',
-          type = 'table',
+          type = '{number}',
           description = [[
           description = [[
             The glow color of the material (sometimes called emissive).  The table contains the `r`,
             The glow color of the material (sometimes called emissive).  The table contains the `r`,
             `g`, and `b` components of the color from 0 to 1, and a fourth number indicating the
             `g`, and `b` components of the color from 0 to 1, and a fourth number indicating the
@@ -35,12 +31,12 @@ return {
         },
         },
         {
         {
           name = 'uvShift',
           name = 'uvShift',
-          type = 'table',
+          type = '{number}',
           description = 'A table with 2 numbers indicating an offset to apply to UVs.'
           description = 'A table with 2 numbers indicating an offset to apply to UVs.'
         },
         },
         {
         {
           name = 'uvScale',
           name = 'uvScale',
-          type = 'table',
+          type = '{number}',
           description = [[
           description = [[
             A table with 2 numbers indicating a scale to apply to UVs.  By default, shaders apply
             A table with 2 numbers indicating a scale to apply to UVs.  By default, shaders apply
             the UV scale before the UV offset.
             the UV scale before the UV offset.
@@ -101,17 +97,17 @@ return {
         },
         },
         {
         {
           name = 'texture',
           name = 'texture',
-          type = 'number',
+          type = 'number | nil',
           description = 'The index of the Image used for the color texture.',
           description = 'The index of the Image used for the color texture.',
         },
         },
         {
         {
           name = 'glowTexture',
           name = 'glowTexture',
-          type = 'number',
+          type = 'number | nil',
           description = 'The index of the Image used for the glow texture.',
           description = 'The index of the Image used for the glow texture.',
         },
         },
         {
         {
           name = 'occlusionTexture',
           name = 'occlusionTexture',
-          type = 'number',
+          type = 'number | nil',
           description = [[
           description = [[
             The index of the Image used for the ambient occlusion texture.  The red channel of the
             The index of the Image used for the ambient occlusion texture.  The red channel of the
             texture is used for ambient occlusion, allowing multiple parameters to use the same
             texture is used for ambient occlusion, allowing multiple parameters to use the same
@@ -120,7 +116,7 @@ return {
         },
         },
         {
         {
           name = 'metalnessTexture',
           name = 'metalnessTexture',
-          type = 'number',
+          type = 'number | nil',
           description = [[
           description = [[
             The index of the Image used for the metalness texture.  The blue channel of the texture
             The index of the Image used for the metalness texture.  The blue channel of the texture
             is used for metalness, allowing multiple parameters to use the same texture.
             is used for metalness, allowing multiple parameters to use the same texture.
@@ -128,7 +124,7 @@ return {
         },
         },
         {
         {
           name = 'roughnessTexture',
           name = 'roughnessTexture',
-          type = 'number',
+          type = 'number | nil',
           description = [[
           description = [[
             The index of the Image to use for the roughness texture.  The green channel of the
             The index of the Image to use for the roughness texture.  The green channel of the
             texture is used for roughness, allowing multiple parameters to use the same texture.
             texture is used for roughness, allowing multiple parameters to use the same texture.
@@ -136,7 +132,7 @@ return {
         },
         },
         {
         {
           name = 'clearcoatTexture',
           name = 'clearcoatTexture',
-          type = 'number',
+          type = 'number | nil',
           description = [[
           description = [[
             The index of the Image to use for the clearcoat texture.  The red channel of the texture
             The index of the Image to use for the clearcoat texture.  The red channel of the texture
             is used for the clearcoat parameter, allowing multiple parameters to use the same
             is used for the clearcoat parameter, allowing multiple parameters to use the same
@@ -145,7 +141,7 @@ return {
         },
         },
         {
         {
           name = 'normalTexture',
           name = 'normalTexture',
-          type = 'number',
+          type = 'number | nil',
           description = 'The index of the Image to use for the normal map.'
           description = 'The index of the Image to use for the normal map.'
         }
         }
       }
       }
@@ -153,15 +149,10 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'properties' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'material' },
       returns = { 'properties' }
       returns = { 'properties' }
     }
     }
   },
   },
-  notes = 'All images are optional and may be `nil`.',
   related = {
   related = {
     'ModelData:getMaterialCount',
     'ModelData:getMaterialCount',
     'ModelData:getMeshMaterial',
     'ModelData:getMeshMaterial',

+ 6 - 15
api/lovr/data/ModelData/getNodeChildren.lua

@@ -4,32 +4,23 @@ return {
     Given a parent node, this function returns a table with the indices of its children.
     Given a parent node, this function returns a table with the indices of its children.
   ]],
   ]],
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the parent node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the parent node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of the parent node.'
     }
     }
   },
   },
   returns = {
   returns = {
     children = {
     children = {
-      type = 'table',
-      description = 'A table containing a node index for each child of the node.'
+      type = '{number}',
+      description = 'A table containing the node index of each child of the parent node.'
     }
     }
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'children' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'children' }
       returns = { 'children' }
     }
     }
   },
   },
-  notes = 'If the node does not have any children, this function returns an empty table.',
   related = {
   related = {
     'ModelData:getNodeParent',
     'ModelData:getNodeParent',
     'ModelData:getRootNode',
     'ModelData:getRootNode',

+ 4 - 12
api/lovr/data/ModelData/getNodeMeshes.lua

@@ -6,13 +6,9 @@ return {
     multiple meshes, and meshes can be reused in multiple nodes.
     multiple meshes, and meshes can be reused in multiple nodes.
   ]],
   ]],
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of a node.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -23,11 +19,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'meshes' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'meshes' }
       returns = { 'meshes' }
     }
     }
   },
   },

+ 4 - 12
api/lovr/data/ModelData/getNodeOrientation.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get the local orientation of a node.',
   summary = 'Get the local orientation of a node.',
   description = 'Returns local orientation of a node, relative to its parent.',
   description = 'Returns local orientation of a node, relative to its parent.',
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of a node.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -31,11 +27,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'angle', 'ax', 'ay', 'az' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'angle', 'ax', 'ay', 'az' }
       returns = { 'angle', 'ax', 'ay', 'az' }
     }
     }
   },
   },

+ 5 - 13
api/lovr/data/ModelData/getNodeParent.lua

@@ -2,28 +2,20 @@ return {
   summary = 'Get the parent of a node.',
   summary = 'Get the parent of a node.',
   description = 'Given a child node, this function returns the index of its parent.',
   description = 'Given a child node, this function returns the index of its parent.',
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the child node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the child node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of the child node.'
     }
     }
   },
   },
   returns = {
   returns = {
     parent = {
     parent = {
       type = 'number',
       type = 'number',
-      description = 'The index of the parent.'
+      description = 'The index of the parent node.'
     }
     }
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'parent' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'parent' }
       returns = { 'parent' }
     }
     }
   },
   },

+ 4 - 12
api/lovr/data/ModelData/getNodePose.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get the local pose of a node.',
   summary = 'Get the local pose of a node.',
   description = 'Returns local pose (position and orientation) of a node, relative to its parent.',
   description = 'Returns local pose (position and orientation) of a node, relative to its parent.',
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of a node.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -43,11 +39,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
       returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
     }
     }
   },
   },

+ 4 - 12
api/lovr/data/ModelData/getNodePosition.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get the local position of a node.',
   summary = 'Get the local position of a node.',
   description = 'Returns local position of a node, relative to its parent.',
   description = 'Returns local position of a node, relative to its parent.',
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of a node.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -27,11 +23,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'x', 'y', 'z' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'x', 'y', 'z' }
       returns = { 'x', 'y', 'z' }
     }
     }
   },
   },

+ 4 - 12
api/lovr/data/ModelData/getNodeScale.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get the local scale of a node.',
   summary = 'Get the local scale of a node.',
   description = 'Returns local scale of a node, relative to its parent.',
   description = 'Returns local scale of a node, relative to its parent.',
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of a node.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -27,11 +23,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'sx', 'sy', 'sz' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'sx', 'sy', 'sz' }
       returns = { 'sx', 'sy', 'sz' }
     }
     }
   },
   },

+ 4 - 12
api/lovr/data/ModelData/getNodeSkin.lua

@@ -6,13 +6,9 @@ return {
     animation of its meshes.
     animation of its meshes.
   ]],
   ]],
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of a node.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -23,11 +19,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'skin' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'skin' }
       returns = { 'skin' }
     }
     }
   },
   },

+ 4 - 12
api/lovr/data/ModelData/getNodeTransform.lua

@@ -4,13 +4,9 @@ return {
     Returns local transform (position, orientation, and scale) of a node, relative to its parent.
     Returns local transform (position, orientation, and scale) of a node, relative to its parent.
   ]],
   ]],
   arguments = {
   arguments = {
-    index = {
-      type = 'number',
-      description = 'The index of the node.'
-    },
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
+    node = {
+      type = 'string | number',
+      description = 'The name or index of a node.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -57,11 +53,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'index' },
-      returns = { 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az' }
-    },
-    {
-      arguments = { 'name' },
+      arguments = { 'node' },
       returns = { 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az' }
       returns = { 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az' }
     }
     }
   },
   },

+ 0 - 1
api/lovr/data/ModelData/getSkinCount.lua

@@ -17,7 +17,6 @@ return {
       returns = { 'count' }
       returns = { 'count' }
     }
     }
   },
   },
-  notes = 'There is currently a maximum of 256 skins.',
   related = {
   related = {
     'Model:hasJoints'
     'Model:hasJoints'
   }
   }

+ 1 - 0
api/lovr/data/ModelData/getSkinJoints.lua

@@ -13,6 +13,7 @@ return {
       description = 'The joints in the skin.'
       description = 'The joints in the skin.'
     }
     }
   },
   },
+  notes = 'There is currently a maximum of 256 joints per skin.',
   variants = {
   variants = {
     {
     {
       arguments = { 'skin' },
       arguments = { 'skin' },

+ 11 - 13
api/lovr/data/Rasterizer/getAdvance.lua

@@ -5,13 +5,9 @@ return {
     advance the cursor after rendering the glyph.
     advance the cursor after rendering the glyph.
   ]],
   ]],
   arguments = {
   arguments = {
-    character = {
-      type = 'string',
-      description = 'A character.'
-    },
-    codepoint = {
-      type = 'number',
-      description = 'A codepoint.'
+    glyph = {
+      type = 'string | number',
+      description = 'A character or codepoint.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -22,12 +18,14 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'character' },
-      returns = { 'advance' }
-    },
-    {
-      arguments = { 'codepoint' },
+      arguments = { 'glyph' },
       returns = { 'advance' }
       returns = { 'advance' }
     }
     }
-  }
+  },
+  example = [[
+    local rasterizer = lovr.data.newRasterizer()
+    local advance1 = rasterizer:getAdvance('H') + rasterizer:getAdvance('i')
+    local advance2 = rasterizer:getAdvance(72) + rasterizer:getAdvance(105)
+    assert(advance1 == advance2)
+  ]]
 }
 }

+ 11 - 13
api/lovr/data/Rasterizer/getBearing.lua

@@ -5,13 +5,9 @@ return {
     the cursor to the edge of the glyph.
     the cursor to the edge of the glyph.
   ]],
   ]],
   arguments = {
   arguments = {
-    character = {
-      type = 'string',
-      description = 'A character.'
-    },
-    codepoint = {
-      type = 'number',
-      description = 'A codepoint.'
+    glyph = {
+      type = 'string | number',
+      description = 'A character or codepoint.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -22,12 +18,14 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'character' },
-      returns = { 'bearing' }
-    },
-    {
-      arguments = { 'codepoint' },
+      arguments = { 'glyph' },
       returns = { 'bearing' }
       returns = { 'bearing' }
     }
     }
-  }
+  },
+  example = [[
+    local rasterizer = lovr.data.newRasterizer()
+
+    -- In the default font, H is wider than i
+    assert(rasterizer:getBearing('H') > rasterizer:getBearing('i'))
+  ]]
 }
 }

+ 6 - 12
api/lovr/data/Rasterizer/getBoundingBox.lua

@@ -5,13 +5,9 @@ return {
     coordinates use a cartesian "y up" coordinate system.
     coordinates use a cartesian "y up" coordinate system.
   ]],
   ]],
   arguments = {
   arguments = {
-    character = {
-      type = 'string',
-      description = 'A character.'
-    },
-    codepoint = {
-      type = 'number',
-      description = 'A codepoint.'
+    glyph = {
+      type = 'string | number',
+      description = 'A character or codepoint.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -34,14 +30,12 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'character' },
-      returns = { 'x1', 'y1', 'x2', 'y2' }
-    },
-    {
-      arguments = { 'codepoint' },
+      description = 'Get the bounding box of a single glyph.',
+      arguments = { 'glyph' },
       returns = { 'x1', 'y1', 'x2', 'y2' }
       returns = { 'x1', 'y1', 'x2', 'y2' }
     },
     },
     {
     {
+      description = 'Get the bounding box around all glyphs in the font.',
       arguments = {},
       arguments = {},
       returns = { 'x1', 'y1', 'x2', 'y2' }
       returns = { 'x1', 'y1', 'x2', 'y2' }
     }
     }

+ 4 - 12
api/lovr/data/Rasterizer/getCurves.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get the bezier curves defining a glyph.',
   summary = 'Get the bezier curves defining a glyph.',
   description = 'Returns the bezier curve control points defining the shape of a glyph.',
   description = 'Returns the bezier curve control points defining the shape of a glyph.',
   arguments = {
   arguments = {
-    character = {
-      type = 'string',
-      description = 'A character.'
-    },
-    codepoint = {
-      type = 'number',
-      description = 'A codepoint.'
+    glyph = {
+      type = 'string | number',
+      description = 'A character or codepoint.'
     },
     },
     three = {
     three = {
       type = 'boolean',
       type = 'boolean',
@@ -26,11 +22,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'character', 'three' },
-      returns = { 'curves' }
-    },
-    {
-      arguments = { 'codepoint', 'three' },
+      arguments = { 'glyph', 'three' },
       returns = { 'curves' }
       returns = { 'curves' }
     }
     }
   },
   },

+ 6 - 12
api/lovr/data/Rasterizer/getDimensions.lua

@@ -1,14 +1,12 @@
 return {
 return {
   summary = 'Get the dimensions of a glyph, or the font.',
   summary = 'Get the dimensions of a glyph, or the font.',
-  description = 'Returns the dimensions of a glyph, or the dimensions of any glyph.',
+  description = [[
+    Returns the dimensions of a glyph, or the largest dimensions of any glyph in the font.
+  ]],
   arguments = {
   arguments = {
-    character = {
+    glyph = {
       type = 'string',
       type = 'string',
-      description = 'A character.'
-    },
-    codepoint = {
-      type = 'number',
-      description = 'A codepoint.'
+      description = 'A character or codepoint.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -23,11 +21,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'character' },
-      returns = { 'width', 'height' }
-    },
-    {
-      arguments = { 'codepoint' },
+      arguments = { 'glyph' },
       returns = { 'width', 'height' }
       returns = { 'width', 'height' }
     },
     },
     {
     {

+ 1 - 1
api/lovr/data/Rasterizer/getFontSize.lua

@@ -2,7 +2,7 @@ return {
   summary = 'Get the size of the font.',
   summary = 'Get the size of the font.',
   description = [[
   description = [[
     Returns the size of the font, in pixels.  This is the size the rasterizer was created with, and
     Returns the size of the font, in pixels.  This is the size the rasterizer was created with, and
-    defines the size of images it rasterizes.
+    determines the size of images it rasterizes.
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {

+ 5 - 13
api/lovr/data/Rasterizer/getHeight.lua

@@ -1,14 +1,10 @@
 return {
 return {
   summary = 'Get the height of a glyph, or the font.',
   summary = 'Get the height of a glyph, or the font.',
-  description = 'Returns the height of a glyph, or the maximum height of any glyph.',
+  description = 'Returns the height of a glyph, or the maximum height of any glyph in the font.',
   arguments = {
   arguments = {
-    character = {
-      type = 'string',
-      description = 'A character.'
-    },
-    codepoint = {
-      type = 'number',
-      description = 'A codepoint.'
+    glyph = {
+      type = 'string | number',
+      description = 'A character or codepoint.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -19,11 +15,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'character' },
-      returns = { 'height' }
-    },
-    {
-      arguments = { 'codepoint' },
+      arguments = { 'glyph' },
       returns = { 'height' }
       returns = { 'height' }
     },
     },
     {
     {

+ 4 - 25
api/lovr/data/Rasterizer/getKerning.lua

@@ -6,21 +6,12 @@ return {
   ]],
   ]],
   arguments = {
   arguments = {
     first = {
     first = {
-      type = 'string',
-      description = 'The first character.'
-    },
-    firstCodepoint = {
-      type = 'number',
-      description = 'The first codepoint.'
+      type = 'string | number',
+      description = 'The character or codepoint representing the first glyph.'
     },
     },
     second = {
     second = {
-      type = 'string',
-      description = 'The second character.'
-    },
-    secondCodepoint = {
-      name = 'secondCodepoint',
-      type = 'number',
-      description = 'The second codepoint.'
+      type = 'string | number',
+      description = 'The character or codepoint representing the second glyph.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -33,18 +24,6 @@ return {
     {
     {
       arguments = { 'first', 'second' },
       arguments = { 'first', 'second' },
       returns = { 'keming' }
       returns = { 'keming' }
-    },
-    {
-      arguments = { 'firstCodepoint', 'second' },
-      returns = { 'keming' }
-    },
-    {
-      arguments = { 'first', 'secondCodepoint' },
-      returns = { 'keming' }
-    },
-    {
-      arguments = { 'firstCodepoint', 'secondCodepoint' },
-      returns = { 'keming' }
     }
     }
   },
   },
   related = {
   related = {

+ 5 - 13
api/lovr/data/Rasterizer/getWidth.lua

@@ -1,14 +1,10 @@
 return {
 return {
   summary = 'Get the width of a glyph, or the font.',
   summary = 'Get the width of a glyph, or the font.',
-  description = 'Returns the width of a glyph, or the maximum width of any glyph.',
+  description = 'Returns the width of a glyph, or the maximum width of any glyph in the font.',
   arguments = {
   arguments = {
-    character = {
-      type = 'string',
-      description = 'A character.'
-    },
-    codepoint = {
-      type = 'number',
-      description = 'A codepoint.'
+    glyph = {
+      type = 'string | number',
+      description = 'A character or codepoint.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -19,11 +15,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'character' },
-      returns = { 'width' }
-    },
-    {
-      arguments = { 'codepoint' },
+      arguments = { 'glyph' },
       returns = { 'width' }
       returns = { 'width' }
     },
     },
     {
     {

+ 13 - 2
api/lovr/data/Rasterizer/hasGlyphs.lua

@@ -3,8 +3,8 @@ return {
   description = 'Returns whether the Rasterizer can rasterize a set of glyphs.',
   description = 'Returns whether the Rasterizer can rasterize a set of glyphs.',
   arguments = {
   arguments = {
     ['...'] = {
     ['...'] = {
-      type = '*',
-      description = 'Strings (sets of characters) or numbers (character codes) to check for.'
+      type = 'string | number',
+      description = 'Strings (characters) or numbers (codepoints) to check for.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -21,6 +21,17 @@ return {
       returns = { 'hasGlyphs' }
       returns = { 'hasGlyphs' }
     }
     }
   },
   },
+  example = [[
+    rasterizer = lovr.data.newRasterizer()
+
+    function lovr.draw(pass)
+      if rasterizer:hasGlyphs('Ö') then
+        pass:text('LÖVR!!!', 0, 2, -3)
+      else
+        pass:text('>:(', 0, 2, -3)
+      end
+    end
+  ]],
   related = {
   related = {
     'Rasterizer:getGlyphCount'
     'Rasterizer:getGlyphCount'
   }
   }

+ 4 - 12
api/lovr/data/Rasterizer/newImage.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Get an Image of a rasterized glyph.',
   summary = 'Get an Image of a rasterized glyph.',
   description = 'Returns an `Image` containing a rasterized glyph.',
   description = 'Returns an `Image` containing a rasterized glyph.',
   arguments = {
   arguments = {
-    character = {
-      type = 'string',
-      description = 'A character.'
-    },
-    codepoint = {
-      type = 'number',
-      description = 'A codepoint.'
+    glyph = {
+      type = 'string | number',
+      description = 'A character or codepoint to rasterize.'
     },
     },
     spread = {
     spread = {
       type = 'number',
       type = 'number',
@@ -29,11 +25,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'character', 'spread', 'padding' },
-      returns = { 'image' }
-    },
-    {
-      arguments = { 'codepoint', 'spread', 'padding' },
+      arguments = { 'glyph', 'spread', 'padding' },
       returns = { 'image' }
       returns = { 'image' }
     }
     }
   },
   },

+ 1 - 1
api/lovr/data/Sound/getFrames.lua

@@ -41,7 +41,7 @@ return {
   },
   },
   returns = {
   returns = {
     t = {
     t = {
-      type = 'table',
+      type = '{number}',
       description = 'A table containing audio frames.'
       description = 'A table containing audio frames.'
     },
     },
     count = {
     count = {

+ 4 - 20
api/lovr/data/Sound/setFrames.lua

@@ -2,17 +2,9 @@ return {
   summary = 'Write frames to the Sound.',
   summary = 'Write frames to the Sound.',
   description = 'Writes frames to the Sound.',
   description = 'Writes frames to the Sound.',
   arguments = {
   arguments = {
-    t = {
-      type = 'table',
-      description = 'A table containing frames to write.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'A Blob containing frames to write.'
-    },
-    sound = {
-      type = 'Sound',
-      description = 'Another Sound to copy frames from.'
+    source = {
+      type = 'table | Blob | Sound',
+      description = 'A table, Blob, or Sound containing audio frames to write.'
     },
     },
     count = {
     count = {
       type = 'number',
       type = 'number',
@@ -38,15 +30,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 't', 'count', 'dstOffset', 'srcOffset' },
-      returns = { 'count' }
-    },
-    {
-      arguments = { 'blob', 'count', 'dstOffset', 'srcOffset' },
-      returns = { 'count' }
-    },
-    {
-      arguments = { 'sound', 'count', 'dstOffset', 'srcOffset' },
+      arguments = { 'source', 'count', 'dstOffset', 'srcOffset' },
       returns = { 'count' }
       returns = { 'count' }
     }
     }
   },
   },

+ 6 - 15
api/lovr/data/newImage.lua

@@ -1,8 +1,8 @@
 return {
 return {
   summary = 'Create a new Image.',
   summary = 'Create a new Image.',
   description = [[
   description = [[
-    Creates a new Image.  Image data can be loaded and decoded from an image file, or a raw block of
-    pixels with a specified width, height, and format can be created.
+    Creates a new Image.  Image data can be loaded and decoded from an image file.  Alternatively, a
+    blank image can be created with a given width, height, and format.
   ]],
   ]],
   arguments = {
   arguments = {
     width = {
     width = {
@@ -18,13 +18,9 @@ return {
       default = 'rgba8',
       default = 'rgba8',
       description = 'The format of the texture\'s pixels.'
       description = 'The format of the texture\'s pixels.'
     },
     },
-    filename = {
-      type = 'string',
-      description = 'The filename of the image to load.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'The Blob containing image data to decode.'
+    file = {
+      type = 'string | Blob',
+      description = 'A filename or Blob containing an image file to load.'
     },
     },
     data = {
     data = {
       type = 'Blob',
       type = 'Blob',
@@ -45,7 +41,7 @@ return {
   variants = {
   variants = {
     {
     {
       description = 'Load image data from a file.',
       description = 'Load image data from a file.',
-      arguments = { 'filename' },
+      arguments = { 'file' },
       returns = { 'image' }
       returns = { 'image' }
     },
     },
     {
     {
@@ -57,11 +53,6 @@ return {
       description = 'Clone an existing Image.',
       description = 'Clone an existing Image.',
       arguments = { 'source' },
       arguments = { 'source' },
       returns = { 'image' }
       returns = { 'image' }
-    },
-    {
-      description = 'Decode image data from a Blob.',
-      arguments = { 'blob' },
-      returns = { 'image' }
     }
     }
   },
   },
   notes = [[
   notes = [[

+ 4 - 12
api/lovr/data/newModelData.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Create a new ModelData.',
   summary = 'Create a new ModelData.',
   description = 'Loads a 3D model from a file.  The supported 3D file formats are OBJ and glTF.',
   description = 'Loads a 3D model from a file.  The supported 3D file formats are OBJ and glTF.',
   arguments = {
   arguments = {
-    filename = {
-      type = 'string',
-      description = 'The filename of the model to load.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'The Blob containing data for a model to decode.'
+    file = {
+      type = 'string | Blob',
+      description = 'A filename or Blob containing the model data to import.'
     }
     }
   },
   },
   returns = {
   returns = {
@@ -19,11 +15,7 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'filename' },
-      returns = { 'modelData' }
-    },
-    {
-      arguments = { 'blob' },
+      arguments = { 'file' },
       returns = { 'modelData' }
       returns = { 'modelData' }
     }
     }
   }
   }

+ 6 - 14
api/lovr/data/newRasterizer.lua

@@ -2,13 +2,9 @@ return {
   summary = 'Create a new Rasterizer.',
   summary = 'Create a new Rasterizer.',
   description = 'Creates a new Rasterizer from a TTF or BMFont file.',
   description = 'Creates a new Rasterizer from a TTF or BMFont file.',
   arguments = {
   arguments = {
-    filename = {
-      type = 'string',
-      description = 'The filename of the font file to load.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'The Blob containing font data.'
+    file = {
+      type = 'string | Blob',
+      description = 'A filename or Blob containing the font file to load.'
     },
     },
     size = {
     size = {
       type = 'number',
       type = 'number',
@@ -28,16 +24,12 @@ return {
   },
   },
   variants = {
   variants = {
     {
     {
-      description = 'Create a Rasterizer for the default font included with LÖVR (Varela Round).',
-      arguments = { 'size' },
-      returns = { 'rasterizer' }
-    },
-    {
-      arguments = { 'filename', 'size' },
+      arguments = { 'file', 'size' },
       returns = { 'rasterizer' }
       returns = { 'rasterizer' }
     },
     },
     {
     {
-      arguments = { 'blob', 'size' },
+      description = 'Create a Rasterizer for the default font included with LÖVR (Varela Round).',
+      arguments = { 'size' },
       returns = { 'rasterizer' }
       returns = { 'rasterizer' }
     }
     }
   }
   }

+ 10 - 20
api/lovr/data/newSound.lua

@@ -33,23 +33,20 @@ return {
       description = 'The sample rate, in Hz.'
       description = 'The sample rate, in Hz.'
     },
     },
     contents = {
     contents = {
-      type = '*',
+      type = [[Blob | 'stream' | nil]],
       default = 'nil',
       default = 'nil',
       description = [[
       description = [[
         A Blob containing raw audio samples to use as the initial contents, 'stream' to create an
         A Blob containing raw audio samples to use as the initial contents, 'stream' to create an
         audio stream, or `nil` to leave the data initialized to zero.
         audio stream, or `nil` to leave the data initialized to zero.
       ]]
       ]]
     },
     },
-    filename = {
-      type = 'string',
-      description = 'The filename of a sound to load.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'The Blob containing audio file data to load.'
+    file = {
+      type = 'string | Blob',
+      description = 'A filename or Blob containing a sound file to load.'
     },
     },
     decode = {
     decode = {
       type = 'boolean',
       type = 'boolean',
+      default = 'false',
       description = 'Whether compressed audio files should be immediately decoded.'
       description = 'Whether compressed audio files should be immediately decoded.'
     }
     }
   },
   },
@@ -67,20 +64,13 @@ return {
     },
     },
     {
     {
       description = [[
       description = [[
-        Load a sound from a file.  Compressed audio formats (OGG, MP3) can optionally be decoded
-        into raw sounds.
-      ]],
-      arguments = { 'filename', 'decode' },
-      returns = { 'sound' }
-    },
-    {
-      description = [[
-        Load a sound from a Blob containing the data of an audio file.  Compressed audio formats
-        (OGG, MP3) can optionally be decoded into raw sounds.
+        Load a sound from a filename or Blob containing the data of an audio file.  Compressed audio
+        formats (OGG, MP3) can optionally be decoded into raw sounds.
 
 
-        If the Blob contains raw audio samples, use the first variant instead of this one.
+        If you want to load a Blob containing raw audio samples, use the first variant of this
+        function and pass the Blob as the `contents`.
       ]],
       ]],
-      arguments = { 'blob', 'decode' },
+      arguments = { 'file', 'decode' },
       returns = { 'sound' }
       returns = { 'sound' }
     }
     }
   },
   },

+ 2 - 2
api/lovr/graphics/Model/getAnimationName.lua

@@ -9,8 +9,8 @@ return {
   },
   },
   returns = {
   returns = {
     name = {
     name = {
-      type = 'string',
-      description = 'The name of the animation.'
+      type = 'string | nil',
+      description = 'The name of the animation, or `nil` if the animation doesn\'t have a name.'
     }
     }
   },
   },
   variants = {
   variants = {

Some files were not shown because too many files changed in this diff