# Not sure to apply extend found in example

**URL:** <https://phaser.discourse.group/t/not-sure-to-apply-extend-found-in-example/10422>\
**Category:** Phaser 3\
**Created:** [October 12, 2021, 11:05pm UTC](https://phaser.discourse.group/t/not-sure-to-apply-extend-found-in-example/10422 "2021-10-12T23:05:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![3b33](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/3b33/32/3334_2.png) [@3b33](https://phaser.discourse.group/u/3b33)\
**Post date:** [October 12, 2021, 11:05pm UTC](https://phaser.discourse.group/t/not-sure-to-apply-extend-found-in-example/10422/1 "2021-10-12T23:05:44Z")

</div>

I’m using a Palette Swapping example so the Scene in my Config is different than what is normally found in examples:

```javascript
var config = {
	
    type: Phaser.AUTO,
    parent: 'phaser-game',
  scene: [MyGame.Boot],    
    width: 1200,
    height: 600
	    
};

```

I want to use Speech Bubble ([Phaser - Examples - Speech Bubble](https://phaser.io/examples/v3/view/game-objects/text/speech-bubble)). In the Config the Scene contains an “extend”. I’m not sure how to apply that to my current code nor do I know exactly what “Extends” do.

Speech Bubble:

```javascript
var config = {
    type: Phaser.AUTO,
    width: 800,
    height: 600,
    parent: 'phaser-example',
    scene: {
        preload: preload,
        create: create,
        extend: {
            createSpeechBubble: createSpeechBubble
        }
    }
};

```

---

<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:** [October 12, 2021, 11:23pm UTC](https://phaser.discourse.group/t/not-sure-to-apply-extend-found-in-example/10422/2 "2021-10-12T23:23:30Z")

</div>

What does `MyGame.Boot` look like?

---

<div class="post-metadata">

**Author:** ![NickHatBoecker](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/nickhatboecker/32/5380_2.png) [@NickHatBoecker](https://phaser.discourse.group/u/NickHatBoecker)\
**Post date:** [October 13, 2021, 9:25pm UTC](https://phaser.discourse.group/t/not-sure-to-apply-extend-found-in-example/10422/3 "2021-10-13T21:25:40Z")

</div>

I think `extend` is used to add the `createSpeechBubble` function to the scene object, so it can be accessed via `this.createSpeechBubble` in the `create` function.

If `MyGame.Boot` is a class, you could just copy the `createSpeechBubble` to your class without using `extend`.
