newMaterial.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. return {
  2. tag = 'graphicsObjects',
  3. summary = 'Create a new Material.',
  4. description = [[
  5. Creates a new Material. Materials are sets of colors, textures, and other parameters that
  6. affect the appearance of objects. They can be applied to `Model`s, `Mesh`es, and most graphics
  7. primitives accept a Material as an optional first argument.
  8. ]],
  9. arguments = {
  10. texture = {
  11. type = 'Texture',
  12. description = 'The diffuse texture.'
  13. },
  14. canvas = {
  15. type = 'Canvas',
  16. description = 'A Canvas to use as the diffuse texture.'
  17. },
  18. r = {
  19. type = 'number',
  20. default = '1',
  21. description = 'The red component of the diffuse color.'
  22. },
  23. g = {
  24. type = 'number',
  25. default = '1',
  26. description = 'The green component of the diffuse color.'
  27. },
  28. b = {
  29. type = 'number',
  30. default = '1',
  31. description = 'The blue component of the diffuse color.'
  32. },
  33. a = {
  34. type = 'number',
  35. default = '1',
  36. description = 'The alpha component of the diffuse color.'
  37. },
  38. hex = {
  39. type = 'number',
  40. default = '0xffffff',
  41. description = 'A hexcode to use for the diffuse color (alpha is not supported).'
  42. }
  43. },
  44. returns = {
  45. material = {
  46. type = 'Material',
  47. description = 'The new Material.'
  48. }
  49. },
  50. variants = {
  51. {
  52. arguments = {},
  53. returns = { 'material' }
  54. },
  55. {
  56. arguments = { 'texture', 'r', 'g', 'b', 'a' },
  57. returns = { 'material' }
  58. },
  59. {
  60. arguments = { 'canvas', 'r', 'g', 'b', 'a' },
  61. returns = { 'material' }
  62. },
  63. {
  64. arguments = { 'r', 'g', 'b', 'a' },
  65. returns = { 'material' }
  66. },
  67. {
  68. arguments = { 'hex' },
  69. returns = { 'material' }
  70. }
  71. },
  72. notes = [[
  73. - Scalar properties will default to `1.0`.
  74. - Color properties will default to `(1.0, 1.0, 1.0, 1.0)`, except for `emissive` which will
  75. default to `(0.0, 0.0, 0.0, 0.0)`.
  76. - Textures will default to `nil` (a single 1x1 white pixel will be used for them).
  77. ]]
  78. }