From 13c5dc317abe0fb4458e703f2ab9397a7c24c859 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 16 Nov 2015 16:58:18 +0200 Subject: Rengöring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/button.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/button.js (limited to 'src/button.js') 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 -- cgit v1.3