Browse Source

Improve newMaterial docs;

bjorn 6 years ago
parent
commit
480649eb77
2 changed files with 8 additions and 1 deletions
  1. 1 0
      api/init.lua
  2. 7 1
      api/lovr/graphics/newMaterial.lua

+ 1 - 0
api/init.lua

@@ -8208,6 +8208,7 @@ return {
           description = "Creates a new Material.  Materials are sets of colors, textures, and other parameters that affect the appearance of objects.  They can be applied to `Model`s, `Mesh`es, and most graphics primitives accept a Material as an optional first argument.",
           key = "lovr.graphics.newMaterial",
           module = "lovr.graphics",
+          notes = "- Scalar properties will default to `1.0`.\n- Color properties will default to `(1.0, 1.0, 1.0, 1.0)`, except for `emissive` which will\n  default to `(0.0, 0.0, 0.0, 0.0)`.\n- Textures will default to `nil` (a single 1x1 white pixel will be used for them).",
           variants = {
             {
               arguments = {},

+ 7 - 1
api/lovr/graphics/newMaterial.lua

@@ -59,5 +59,11 @@ return {
       arguments = { 'r', 'g', 'b', 'a' },
       returns = { 'material' }
     }
-  }
+  },
+  notes = [[
+    - Scalar properties will default to `1.0`.
+    - Color properties will default to `(1.0, 1.0, 1.0, 1.0)`, except for `emissive` which will
+      default to `(0.0, 0.0, 0.0, 0.0)`.
+    - Textures will default to `nil` (a single 1x1 white pixel will be used for them).
+  ]]
 }