Browse Source

HorizontalAlign; VerticalAlign;

bjorn 7 years ago
parent
commit
ec7df881ef
3 changed files with 94 additions and 0 deletions
  1. 50 0
      api/init.lua
  2. 22 0
      api/lovr/graphics/HorizontalAlign.lua
  3. 22 0
      api/lovr/graphics/VerticalAlign.lua

+ 50 - 0
api/init.lua

@@ -2778,6 +2778,31 @@ return {
             }
           }
         },
+        {
+          name = "HorizontalAlign",
+          summary = "Different ways to horizontally align text.",
+          description = "Different ways to horizontally align text when using `lovr.graphics.print`.",
+          key = "HorizontalAlign",
+          module = "graphics",
+          values = {
+            {
+              name = "left",
+              description = "Left aligned lines of text."
+            },
+            {
+              name = "center",
+              description = "Centered aligned lines of text."
+            },
+            {
+              name = "right",
+              description = "Right aligned lines of text."
+            }
+          },
+          related = {
+            "VerticalAlign",
+            "lovr.graphics.print"
+          }
+        },
         {
           name = "MeshDrawMode",
           summary = "Different ways Mesh objects can be drawn.",
@@ -2858,6 +2883,31 @@ return {
             }
           }
         },
+        {
+          name = "VerticalAlign",
+          summary = "Different ways to vertically align text.",
+          description = "Different ways to vertically align text when using `lovr.graphics.print`.",
+          key = "VerticalAlign",
+          module = "graphics",
+          values = {
+            {
+              name = "top",
+              description = "Align the top of the text to the origin."
+            },
+            {
+              name = "middle",
+              description = "Vertically center the text."
+            },
+            {
+              name = "bottom",
+              description = "Align the bottom of the text to the origin."
+            }
+          },
+          related = {
+            "HorizontalAlign",
+            "lovr.graphics.print"
+          }
+        },
         {
           name = "WrapMode",
           summary = "How to wrap Textures.",

+ 22 - 0
api/lovr/graphics/HorizontalAlign.lua

@@ -0,0 +1,22 @@
+return {
+  summary = 'Different ways to horizontally align text.',
+  description = 'Different ways to horizontally align text when using `lovr.graphics.print`.',
+  values = {
+    {
+      name = 'left',
+      description = 'Left aligned lines of text.'
+    },
+    {
+      name = 'center',
+      description = 'Centered aligned lines of text.'
+    },
+    {
+      name = 'right',
+      description = 'Right aligned lines of text.'
+    }
+  },
+  related = {
+    'VerticalAlign',
+    'lovr.graphics.print'
+  }
+}

+ 22 - 0
api/lovr/graphics/VerticalAlign.lua

@@ -0,0 +1,22 @@
+return {
+  summary = 'Different ways to vertically align text.',
+  description = 'Different ways to vertically align text when using `lovr.graphics.print`.',
+  values = {
+    {
+      name = 'top',
+      description = 'Align the top of the text to the origin.'
+    },
+    {
+      name = 'middle',
+      description = 'Vertically center the text.'
+    },
+    {
+      name = 'bottom',
+      description = 'Align the bottom of the text to the origin.'
+    }
+  },
+  related = {
+    'HorizontalAlign',
+    'lovr.graphics.print'
+  }
+}