# How to create a sprite by "new" operator?

**URL:** <https://phaser.discourse.group/t/how-to-create-a-sprite-by-new-operator/14004>\
**Category:** Phaser 3\
**Created:** [February 18, 2024, 10:23pm UTC](https://phaser.discourse.group/t/how-to-create-a-sprite-by-new-operator/14004 "2024-02-18T22:23:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![QuantumTopology](https://avatars.discourse-cdn.com/v4/letter/q/94ad74/32.png) [@QuantumTopology](https://phaser.discourse.group/u/QuantumTopology)\
**Post date:** [February 18, 2024, 10:23pm UTC](https://phaser.discourse.group/t/how-to-create-a-sprite-by-new-operator/14004/1 "2024-02-18T22:23:22Z")

</div>

Hello, I want to inherit from the **Phaser.GameObjects.Sprite** class, but I find that if I use “new” operator to create the object, nothing will be displayed on the canvas and the displayList property of the sprite is null.

```javascript
let slime = new Phaser.GameObjects.Sprite(this, 100, 100, "slime_normal");
//Nothing is shown on canvas, and the displayList of slime is null
console.log(slime); 

```

So If I simply extend the Phaser.GameObjects.Sprite, nothing will be shown. How to set the displayList property and inherit from the Sprite class ?

---

<div class="post-metadata">

**Author:** ![QuantumTopology](https://avatars.discourse-cdn.com/v4/letter/q/94ad74/32.png) [@QuantumTopology](https://phaser.discourse.group/u/QuantumTopology)\
**Post date:** [February 18, 2024, 11:06pm UTC](https://phaser.discourse.group/t/how-to-create-a-sprite-by-new-operator/14004/2 "2024-02-18T23:06:41Z")

</div>

Maybe I should add this ?

```javascript
//"this" is a scene object
this.add.existing(slime);

```

I find that the sprite shows if I add this line.
