aboutsummaryrefslogtreecommitdiffstats
path: root/src/button.js
blob: a214db3dcaa401cc1977a38d8abd5c6b77537753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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');
	}
}