summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
Diffstat (limited to 'demo')
-rw-r--r--demo/vector/PAPYRUS.ttfbin0 -> 156000 bytes
-rw-r--r--demo/vector/main.lua11
2 files changed, 10 insertions, 1 deletions
diff --git a/demo/vector/PAPYRUS.ttf b/demo/vector/PAPYRUS.ttf
new file mode 100644
index 0000000..a33c7b2
--- /dev/null
+++ b/demo/vector/PAPYRUS.ttf
Binary files differ
diff --git a/demo/vector/main.lua b/demo/vector/main.lua
index fda4bc8..2b29999 100644
--- a/demo/vector/main.lua
+++ b/demo/vector/main.lua
@@ -5,9 +5,12 @@ local nvg = honey.nvg
local vg
+local papyrus
function honey.init()
vg = nvg.CreateContext()
+ papyrus = nvg.CreateFont(vg, "Papyrus", "PAPYRUS.ttf")
+ if (papyrus == -1) then error("failed to find font") end
end
@@ -30,8 +33,14 @@ end
function honey.draw()
nvg.BeginFrame(vg, 640, 480, 1.0)
+
+ nvg.StrokeColor(vg, nvg.RGBf(1, 1, 1))
+ nvg.FontFace(vg, "Papyrus")
+ nvg.Text(vg, 50, 50, "Hello, world! c:")
+
+
nvg.StrokeWidth(vg, 20)
- nvg.StrokeColor(vg, nvg.RGB(1, 0, 0))
+ nvg.StrokeColor(vg, nvg.RGBf(1, 0, 0))
local w = 640
local h = 480