# Render text into different frames of a texture

**URL:** <https://phaser.discourse.group/t/render-text-into-different-frames-of-a-texture/12224>\
**Category:** Phaser 3\
**Created:** [August 27, 2022, 7:01pm UTC](https://phaser.discourse.group/t/render-text-into-different-frames-of-a-texture/12224 "2022-08-27T19:01:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhaserNoob](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@PhaserNoob](https://phaser.discourse.group/u/PhaserNoob)\
**Post date:** [August 27, 2022, 7:01pm UTC](https://phaser.discourse.group/t/render-text-into-different-frames-of-a-texture/12224/1 "2022-08-27T19:01:12Z")

</div>

How can i manually create a texture, add text to a frame and different text to another frame?

I saw examples with images and sprites, but not with text.

Possibly a simple thing, but i really didn’t see the solution.

---

<div class="post-metadata">

**Author:** ![PhaserNoob](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@PhaserNoob](https://phaser.discourse.group/u/PhaserNoob)\
**Post date:** [August 28, 2022, 10:52am UTC](https://phaser.discourse.group/t/render-text-into-different-frames-of-a-texture/12224/2 "2022-08-28T10:52:39Z")

</div>

Could somebody confirm, if this is the right way todo it?  
Or could it be done easier?

```javascript
const rt = this.scene.add.renderTexture(0, 0, 100, 300)
  .setIsSpriteTexture(true) // without everything is flipped
  .setVisible(false)

const text1 = this.scene.add.text(0, 0, 'Text 1')
  .setVisible(false)
rt.draw(text1, 0, 0)

const text2 = this.scene.add.text(0, 0, 'Text 2')
  .setVisible(false)
rt.draw(text2, 0, 100)

rt.texture.add('area1', 0, 0, 0, 100, 100)
rt.texture.add('area2', 0, 0, 100, 100, 100)

```

---

<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:** [August 28, 2022, 5:35pm UTC](https://phaser.discourse.group/t/render-text-into-different-frames-of-a-texture/12224/3 "2022-08-28T17:35:09Z")

</div>

That’s right. But I think you can reuse one text object (style, set text, draw, repeat). That will save creating extra canvases.
