Created
September 14, 2015 10:59
-
-
Save dharma017/dce409abbcda6aef1949 to your computer and use it in GitHub Desktop.
Fill hitarea with rectangular graphics in pixi js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (var i = 0; i < 4; i++) { | |
| var x1 = this.dropParams.position[i * 2], | |
| y1 = this.dropParams.position[i * 2 + 1], | |
| x2 = this.dropParams.position[i * 2] + this.dropParams.w, | |
| y2 = this.dropParams.position[i * 2 + 1] + this.dropParams.h; | |
| var otherObject = new PIXI.DisplayObjectContainer(); | |
| var graphics = new PIXI.Graphics(); | |
| graphics.beginFill(0xFFFFFF, 0.5); | |
| graphics.lineStyle(1, 0x000000, 0.5); | |
| graphics.drawRect(x1, y1, this.dropParams.w, this.dropParams.h); | |
| otherObject.addChild(graphics); | |
| this.introContainer.addChild(otherObject); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment