# generateTexture is not a function error

**URL:** <https://phaser.discourse.group/t/generatetexture-is-not-a-function-error/5190>\
**Category:** Phaser 3\
**Created:** [February 14, 2020, 8:42pm UTC](https://phaser.discourse.group/t/generatetexture-is-not-a-function-error/5190 "2020-02-14T20:42:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![izzy](https://avatars.discourse-cdn.com/v4/letter/i/c2a13f/32.png) [@izzy](https://phaser.discourse.group/u/izzy)\
**Post date:** [February 14, 2020, 8:42pm UTC](https://phaser.discourse.group/t/generatetexture-is-not-a-function-error/5190/1 "2020-02-14T20:42:57Z")

</div>

I don’t understand why generateTexture works on my floor graphics but not on the circle. I tried searching the documentation but I can’t find any examples.

```
floor = this.add.graphics();
disc = this.add.circle(200, 200, 80, 0x6666ff);

floor.fillStyle(0x00ff00, 1);
floor.fillRect(0, 700, 1024, 70);

floor.generateTexture('bottom', 1024, 50);
disc.generateTexture('plinko', 200, 200);   

plinko = this.physics.add.image(100, 300, 'plinko');

plinko.setBounce(0.2);
plinko.setColliderWorldBounds(true);
platform = this.physics.add.image(400, 400, 'bottom');

platform.setImmovable(true);
platform.body.allowGravity = false;
```

---

<div class="post-metadata">

**Author:** ![jjcapellan](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jjcapellan/32/542_2.png) [@jjcapellan](https://phaser.discourse.group/u/jjcapellan)\
**Post date:** [February 14, 2020, 11:35pm UTC](https://phaser.discourse.group/t/generatetexture-is-not-a-function-error/5190/2 "2020-02-14T23:35:56Z")

</div>

Hi @izzy,  
**floor** is of type [Phaser.GameObjects.Graphics](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Graphics.html) which has the generateTexture method.  
**disc** is of type [Phaser.GameObjects.Arc](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Arc.html). This type hasn’t generateTexture method.

Regards.

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [February 14, 2020, 11:37pm UTC](https://phaser.discourse.group/t/generatetexture-is-not-a-function-error/5190/3 "2020-02-14T23:37:20Z")

</div>

I guess you would use CanvasTexture or RenderTexture.
