diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-17 03:39:01 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-17 03:39:01 +0200 |
commit | abfc56b8c4fc768593c7afdd1961aab35c0468c4 (patch) | |
tree | 1d39b8312b4ae0abdf63c3a1708be67f3c873811 /chuck/OSCGraphics.ck | |
parent | d7eb9b29c8bcfd9ca97e0604b5b1868b3967164e (diff) | |
download | osc-graphics-abfc56b8c4fc768593c7afdd1961aab35c0468c4.tar.gz |
all layer constructor methods support an alpha argument
Diffstat (limited to 'chuck/OSCGraphics.ck')
-rw-r--r-- | chuck/OSCGraphics.ck | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/chuck/OSCGraphics.ck b/chuck/OSCGraphics.ck index 6c8dd9f..2c3c25e 100644 --- a/chuck/OSCGraphics.ck +++ b/chuck/OSCGraphics.ck @@ -17,30 +17,36 @@ public class OSCGraphics { return img; } fun static OSCGraphicsImage @ - newImage(int pos, int geo[], string file) + newImage(int pos, int geo[], float opacity, string file) { OSCGraphicsImage img; - img.init(osc_send, "image", "s", pos, "__image_"+free_id, geo); + img.init(osc_send, "image", "s", + pos, "__image_"+free_id, geo, opacity); file => osc_send.addString; free_id++; return img; } fun static OSCGraphicsImage @ + newImage(int pos, int geo[], float opacity) + { + return newImage(pos, geo, opacity, ""); + } + fun static OSCGraphicsImage @ newImage(int pos, int geo[]) { - return newImage(pos, geo, ""); + return newImage(pos, geo, 1., ""); } fun static OSCGraphicsImage @ newImage(int pos) { - return newImage(pos, null, ""); + return newImage(pos, null, 1., ""); } fun static OSCGraphicsImage @ newImage() { - return newImage(-1, null, ""); + return newImage(-1, null, 1., ""); } fun static OSCGraphicsVideo @ @@ -52,30 +58,36 @@ public class OSCGraphics { return video; } fun static OSCGraphicsVideo @ - newVideo(int pos, int geo[], string file) + newVideo(int pos, int geo[], float opacity, string file) { OSCGraphicsVideo video; - video.init(osc_send, "video", "s", pos, "__video_"+free_id, geo); + video.init(osc_send, "video", "s", + pos, "__video_"+free_id, geo, opacity); file => osc_send.addString; free_id++; return video; } fun static OSCGraphicsVideo @ + newVideo(int pos, int geo[], float opacity) + { + return newVideo(pos, geo, 1., ""); + } + fun static OSCGraphicsVideo @ newVideo(int pos, int geo[]) { - return newVideo(pos, geo, ""); + return newVideo(pos, geo, 1., ""); } fun static OSCGraphicsVideo @ newVideo(int pos) { - return newVideo(pos, null, ""); + return newVideo(pos, null, 1., ""); } fun static OSCGraphicsVideo @ newVideo() { - return newVideo(-1, null, ""); + return newVideo(-1, null, 1., ""); } fun static OSCGraphicsBox @ @@ -91,8 +103,8 @@ public class OSCGraphics { { OSCGraphicsBox box; - box.init(osc_send, "box", "fiii", pos, "__box_"+free_id, geo); - opacity => osc_send.addFloat; + box.init(osc_send, "box", "iii", + pos, "__box_"+free_id, geo, opacity); for (0 => int i; i < 3; i++) color[i] => osc_send.addInt; @@ -114,7 +126,6 @@ public class OSCGraphics { { return newBox(-1, null, 1., color); } - } /* static initialization */ new OscSend @=> OSCGraphics.osc_send; |