kuoruan Posted March 22, 2018 Share Posted March 22, 2018 I new a Text object and want draw it on renderTexture let text = new Phaser.GameObjects.Text(scene, x, y, bet.value, { fontFamily: 'Helvetica, Arial', fontSize: '14px', fill: Color.WHITE, align: 'center' }).setOrigin(0.5) // Want renderTexture.draw(text.texture, text.frame, 0, 0) But I can't get the texture and frame of a Text Object. Link to comment Share on other sites More sharing options...
kuoruan Posted March 22, 2018 Author Share Posted March 22, 2018 @rich Can you help me ? Link to comment Share on other sites More sharing options...
PixelPicoSean Posted March 22, 2018 Share Posted March 22, 2018 RenderTexture can only draw texture frames. But you can generate a texture from text inner canvas. Link to comment Share on other sites More sharing options...
kuoruan Posted March 23, 2018 Author Share Posted March 23, 2018 2 hours ago, PixelPicoSean said: RenderTexture can only draw texture frames. But you can generate a texture from text inner canvas. Can you please tell me the detail that generate a texture from text inner canvas? Link to comment Share on other sites More sharing options...
Huang Fusyong Posted April 2, 2021 Share Posted April 2, 2021 On 3/23/2018 at 9:21 AM, kuoruan said: Can you please tell me the detail that generate a texture from text inner canvas? Hi,kuoruan This is the example, maybe: https://labs.phaser.io/edit.html?src=src/textures/text texture.js&v=3.54.0 Link to comment Share on other sites More sharing options...
Recommended Posts