Browse Source

Add color alpha parameter for hexcode variant

Josip Miskovic 4 years ago
parent
commit
e16422b8a5

File diff suppressed because it is too large
+ 668 - 713
api/init.lua


+ 6 - 6
api/lovr/graphics/Material/setColor.lua

@@ -22,14 +22,14 @@ return {
       type = 'number',
       description = 'The blue component of the color.'
     },
+    hex = {
+      type = 'number',
+      description = 'A hexcode to use for the color.'
+    },
     a = {
       type = 'number',
       default = '1.0',
       description = 'The alpha component of the color.'
-    },
-    hex = {
-      type = 'number',
-      description = 'A hexcode to use for the color (alpha is not supported).'
     }
   },
   returns = {},
@@ -43,11 +43,11 @@ return {
       returns = {}
     },
     {
-      arguments = { 'colorType', 'hex' },
+      arguments = { 'colorType', 'hex', 'a' },
       returns = {}
     },
     {
-      arguments = { 'hex' },
+      arguments = { 'hex', 'a' },
       returns = {}
     }
   },

+ 6 - 6
api/lovr/graphics/newMaterial.lua

@@ -30,15 +30,15 @@ return {
       default = '1',
       description = 'The blue component of the diffuse color.'
     },
+    hex = {
+      type = 'number',
+      default = '0xffffff',
+      description = 'A hexcode to use for the diffuse color.'
+    },
     a = {
       type = 'number',
       default = '1',
       description = 'The alpha component of the diffuse color.'
-    },
-    hex = {
-      type = 'number',
-      default = '0xffffff',
-      description = 'A hexcode to use for the diffuse color (alpha is not supported).'
     }
   },
   returns = {
@@ -65,7 +65,7 @@ return {
       returns = { 'material' }
     },
     {
-      arguments = { 'hex' },
+      arguments = { 'hex', 'a' },
       returns = { 'material' }
     }
   },

+ 5 - 5
api/lovr/graphics/setBackgroundColor.lua

@@ -17,15 +17,15 @@ return {
       type = 'number',
       description = 'The blue component of the background color.'
     },
+    hex = {
+      type = 'number',
+      description = 'A hexcode like `0xffffff` to use for the background.'
+    },
     a = {
       type = 'number',
       default = '1.0',
       description = 'The alpha component of the background color.'
     },
-    hex = {
-      type = 'number',
-      description = 'A hexcode like `0xffffff` to use for the background (does not support alpha).'
-    },
     color = {
       type = 'table',
       description = 'A table containing 3 or 4 color components.'
@@ -38,7 +38,7 @@ return {
       returns = {}
     },
     {
-      arguments = { 'hex' },
+      arguments = { 'hex', 'a' },
       returns = {}
     },
     {

+ 5 - 5
api/lovr/graphics/setColor.lua

@@ -19,15 +19,15 @@ return {
       type = 'number',
       description = 'The blue component of the color.'
     },
+    hex = {
+      type = 'number',
+      description = 'A hexcode like `0xffffff` to use for the color.'
+    },
     a = {
       type = 'number',
       default = '1.0',
       description = 'The alpha component of the color.'
     },
-    hex = {
-      type = 'number',
-      description = 'A hexcode like `0xffffff` to use for the color (does not support alpha).'
-    },
     color = {
       type = 'table',
       description = 'A table containing 3 or 4 color components.'
@@ -40,7 +40,7 @@ return {
       returns = {}
     },
     {
-      arguments = { 'hex' },
+      arguments = { 'hex', 'a' },
       returns = {}
     },
     {

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