aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-03-21 16:44:30 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-21 16:44:30 +0000
commit28fed7819d1e0f46044dcadaf7ae1275559a16ec (patch)
tree157c37cb720d1cb3ce662c69ac37e987cf58d0ee
parentlib: add love/tsv-output (diff)
downloadalive-28fed7819d1e0f46044dcadaf7ae1275559a16ec.tar.gz
alive-28fed7819d1e0f46044dcadaf7ae1275559a16ec.zip
lib: add love/font
-rw-r--r--alv-lib/love.moon16
1 files changed, 16 insertions, 0 deletions
diff --git a/alv-lib/love.moon b/alv-lib/love.moon
index 68a402f..d4d198d 100644
--- a/alv-lib/love.moon
+++ b/alv-lib/love.moon
@@ -127,6 +127,21 @@ rectangle = Constant.meta
@out\set ->
love.graphics.rectangle mode, x, y, w, h
+font = Constant.meta
+ meta:
+ name: 'font'
+ summary: "create a font."
+ examples: { '(love/font [filename] size)' }
+
+ value: class extends PureOp
+ pattern: -any.str + any.num
+ type: T['love/font']
+
+ tick: =>
+ { name, size } = @unwrap_all!
+ name, size = size, nil if not name
+ @out\set love.graphics.newFont name, size
+
text = Constant.meta
meta:
name: 'text'
@@ -558,6 +573,7 @@ macro [->>][]:
:draw
'no-shape': no_shape
+ :font
:circle, :ellipse, :line, :rectangle, :text
:translate, :rotate, :scale, :shear