aboutsummaryrefslogtreecommitdiffstats
path: root/src/button.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/button.js')
-rw-r--r--src/button.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/button.js b/src/button.js
new file mode 100644
index 0000000..a214db3
--- /dev/null
+++ b/src/button.js
@@ -0,0 +1,18 @@
+function Button() {
+ this.graphics = new PIXI.Graphics();
+
+ this.graphics.beginFill(0xFFFF00);
+
+ // set the line style to have a width of 5 and set the color to red
+ this.graphics.lineStyle(5, 0xFF0000);
+
+ // draw a rectangle
+ this.graphics.drawRect(100, 150, 50, 50);
+
+ // make the button interactive..
+ this.graphics.setInteractive(true);
+
+ this.graphics.click = function(data) {
+ console.log('hit rect');
+ }
+} \ No newline at end of file