aboutsummaryrefslogtreecommitdiff
path: root/chuck/OSCGraphics.ck
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-10-03 13:06:07 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-10-03 13:06:07 +0200
commit20001cbed6f01461a936ce00e6da51ca1aa4c926 (patch)
treead40829a58be4e5283c8ac9c18353b1ec836e197 /chuck/OSCGraphics.ck
parentb224aef050b4f75b6325cb3b46b70e31d9116fa2 (diff)
downloadosc-graphics-20001cbed6f01461a936ce00e6da51ca1aa4c926.tar.gz
ChucK text layer wrapper
Diffstat (limited to 'chuck/OSCGraphics.ck')
-rw-r--r--chuck/OSCGraphics.ck35
1 files changed, 35 insertions, 0 deletions
diff --git a/chuck/OSCGraphics.ck b/chuck/OSCGraphics.ck
index a4e666a..6c2fcec 100644
--- a/chuck/OSCGraphics.ck
+++ b/chuck/OSCGraphics.ck
@@ -126,6 +126,41 @@ public class OSCGraphics {
{
return newBox(-1, null, 1., color);
}
+
+ fun static OSCGraphicsText @
+ getText(string name)
+ {
+ OSCGraphicsText text;
+ osc_send @=> text.osc_send;
+ name => text.name;
+ return text;
+ }
+ fun static OSCGraphicsText @
+ newText(int pos, int geo[], float opacity, int color[],
+ string txt, string font)
+ {
+ OSCGraphicsText text;
+
+ text.init(osc_send, "text", "iiiss",
+ pos, "__text_"+free_id, geo, opacity);
+ for (0 => int i; i < 3; i++)
+ color[i] => osc_send.addInt;
+ txt => osc_send.addString;
+ font => osc_send.addString;
+
+ free_id++;
+ return text;
+ }
+ fun static OSCGraphicsText @
+ newText(int pos, int geo[], int color[], string txt, string font)
+ {
+ return newText(pos, geo, 1., color, txt, font);
+ }
+ fun static OSCGraphicsText @
+ newText(int geo[], int color[], string txt, string font)
+ {
+ return newText(-1, geo, 1., color, txt, font);
+ }
}
/* static initialization */
new OscSend @=> OSCGraphics.osc_send;