()
| 90 | return this.bounds.contains(x, y); |
| 91 | } |
| 92 | draw() { |
| 93 | let image = this.image; |
| 94 | let label = this.label; |
| 95 | let x = this.bounds.x; |
| 96 | let y = this.bounds.y; |
| 97 | let width = this.bounds.w; |
| 98 | let height = this.bounds.h; |
| 99 | let sx = 0; |
| 100 | let sy = (0 == this.state ? 0 : height); |
| 101 | let color = (0 == this.state ? black : white); |
| 102 | drawBackground(); |
| 103 | render.drawMasked(image, x, y, sx, sy, width, height, image.alpha, sx, sy); |
| 104 | render.drawText(label, font, color, |
| 105 | ((width - render.getTextWidth(label, font)) >> 1) + x, |
| 106 | ((height - font.height) >> 1) + y |
| 107 | ); |
| 108 | } |
| 109 | onTouchBegan(x, y) { |
| 110 | this.anchor.x = this.bounds.x - x; |
| 111 | this.anchor.y = this.bounds.y - y; |
no test coverage detected