Browse Source

Material:getTransform; Material:setTransform;

bjorn 7 years ago
parent
commit
f0d623ed75

+ 78 - 0
api/init.lua

@@ -10782,6 +10782,45 @@ return {
                 }
                 }
               }
               }
             },
             },
+            {
+              name = "getTransform",
+              summary = "Get the transformation applied to texture coordinates.",
+              description = "Returns the transformation applied to texture coordinates of the Material.",
+              key = "Material:getTransform",
+              module = "lovr.graphics",
+              variants = {
+                {
+                  arguments = {},
+                  returns = {
+                    {
+                      name = "ox",
+                      type = "number",
+                      description = "The texture coordinate x offset."
+                    },
+                    {
+                      name = "oy",
+                      type = "number",
+                      description = "The texture coordinate y offset."
+                    },
+                    {
+                      name = "sx",
+                      type = "number",
+                      description = "The texture coordinate x scale."
+                    },
+                    {
+                      name = "sy",
+                      type = "number",
+                      description = "The texture coordinate y scale."
+                    },
+                    {
+                      name = "angle",
+                      type = "number",
+                      description = "The texture coordinate rotation, in radians."
+                    }
+                  }
+                }
+              }
+            },
             {
             {
               name = "setColor",
               name = "setColor",
               summary = "Set a color property of the Material.",
               summary = "Set a color property of the Material.",
@@ -10918,6 +10957,45 @@ return {
                   returns = {}
                   returns = {}
                 }
                 }
               }
               }
+            },
+            {
+              name = "setTransform",
+              summary = "Set the transformation applied to texture coordinates.",
+              description = "Sets the transformation applied to texture coordinates of the Material.  This lets you offset, scale, or rotate textures as they are applied to geometry.",
+              key = "Material:setTransform",
+              module = "lovr.graphics",
+              variants = {
+                {
+                  arguments = {
+                    {
+                      name = "ox",
+                      type = "number",
+                      description = "The texture coordinate x offset."
+                    },
+                    {
+                      name = "oy",
+                      type = "number",
+                      description = "The texture coordinate y offset."
+                    },
+                    {
+                      name = "sx",
+                      type = "number",
+                      description = "The texture coordinate x scale."
+                    },
+                    {
+                      name = "sy",
+                      type = "number",
+                      description = "The texture coordinate y scale."
+                    },
+                    {
+                      name = "angle",
+                      type = "number",
+                      description = "The texture coordinate rotation, in radians."
+                    }
+                  },
+                  returns = {}
+                }
+              }
             }
             }
           },
           },
           constructors = {
           constructors = {

+ 32 - 0
api/lovr/graphics/Material/getTransform.lua

@@ -0,0 +1,32 @@
+return {
+  summary = 'Get the transformation applied to texture coordinates.',
+  description = 'Returns the transformation applied to texture coordinates of the Material.',
+  arguments = {},
+  returns = {
+    {
+      name = 'ox',
+      type = 'number',
+      description = 'The texture coordinate x offset.'
+    },
+    {
+      name = 'oy',
+      type = 'number',
+      description = 'The texture coordinate y offset.'
+    },
+    {
+      name = 'sx',
+      type = 'number',
+      description = 'The texture coordinate x scale.'
+    },
+    {
+      name = 'sy',
+      type = 'number',
+      description = 'The texture coordinate y scale.'
+    },
+    {
+      name = 'angle',
+      type = 'number',
+      description = 'The texture coordinate rotation, in radians.'
+    }
+  }
+}

+ 35 - 0
api/lovr/graphics/Material/setTransform.lua

@@ -0,0 +1,35 @@
+return {
+  summary = 'Set the transformation applied to texture coordinates.',
+  description = [[
+    Sets the transformation applied to texture coordinates of the Material.  This lets you offset,
+    scale, or rotate textures as they are applied to geometry.
+  ]],
+  arguments = {
+    {
+      name = 'ox',
+      type = 'number',
+      description = 'The texture coordinate x offset.'
+    },
+    {
+      name = 'oy',
+      type = 'number',
+      description = 'The texture coordinate y offset.'
+    },
+    {
+      name = 'sx',
+      type = 'number',
+      description = 'The texture coordinate x scale.'
+    },
+    {
+      name = 'sy',
+      type = 'number',
+      description = 'The texture coordinate y scale.'
+    },
+    {
+      name = 'angle',
+      type = 'number',
+      description = 'The texture coordinate rotation, in radians.'
+    }
+  },
+  returns = {}
+}