diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2015-11-16 16:58:18 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2015-11-16 16:58:18 +0200 |
| commit | 13c5dc317abe0fb4458e703f2ab9397a7c24c859 (patch) | |
| tree | 1410e5e6d250cbcadc29a1b66a851473e15da8b6 /src/button.js | |
Rengöring
Diffstat (limited to 'src/button.js')
| -rw-r--r-- | src/button.js | 18 |
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 |
