# Sprite on pointerdown not tinting

**URL:** <https://phaser.discourse.group/t/sprite-on-pointerdown-not-tinting/9634>\
**Category:** Phaser 3\
**Created:** [May 20, 2021, 6:30pm UTC](https://phaser.discourse.group/t/sprite-on-pointerdown-not-tinting/9634 "2021-05-20T18:30:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dustin\_Rogers](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/dustin_rogers/32/5261_2.png) [@Dustin\_Rogers](https://phaser.discourse.group/u/Dustin_Rogers)\
**Post date:** [May 20, 2021, 6:30pm UTC](https://phaser.discourse.group/t/sprite-on-pointerdown-not-tinting/9634/1 "2021-05-20T18:30:28Z")

</div>

I cannot seem to get my sprite to tint…

```
class Metrus extends Phaser.Physics.Arcade.Image {

constructor(scene, x, y, motion, direction, distance, id) {

		unitSprite = this.scene.matter.add.gameObject(this, { shape: 'circle', circleRadius: 15} );	

	unitSprite.displayWidth = 30;
	unitSprite.displayHeight = 30;
	unitSprite.scale = 0.4;

unitSprite.setInteractive().on('pointerdown', function(pointer, localX, localY, event){

if (this.selected == true) {
			//ALREADY SELECTED
			this.clearTint();
			this.selected = false
			selectedCount--;
			
			var deleteIndex = selectedArray.indexOf(this.data.get('id'));
			selectedArray.splice(deleteIndex, 1);
			
		}else{
			//NOT YET SELECTED
			this.selected = true;	
			this.tint = 0xFF0000;
			selectedCount++;
			selectedArray.push(this.data.get('id'));
			
		}

});

}

}
```

---

<div class="post-metadata">

**Author:** ![Dustin\_Rogers](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/dustin_rogers/32/5261_2.png) [@Dustin\_Rogers](https://phaser.discourse.group/u/Dustin_Rogers)\
**Post date:** [May 20, 2021, 7:48pm UTC](https://phaser.discourse.group/t/sprite-on-pointerdown-not-tinting/9634/2 "2021-05-20T19:48:23Z")

</div>

Apparently this was an issue with my type in my game.js config, I set it to:

```
type: Phaser.WEBGL

```

and it worked
