# AdvancedDynamicTexture.CreateForMesh not showing up in babylon react native

**URL:** <https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446>\
**Category:** Questions\
**Tags:** react, native\
**Created:** [March 15, 2022, 2:07pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446 "2022-03-15T14:07:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![HedwigAR](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/hedwigar/32/33214_2.png) [@HedwigAR](https://forum.babylonjs.com/u/HedwigAR)\
**Post date:** [March 15, 2022, 2:07pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446/1 "2022-03-15T14:07:08Z")

</div>

Hi!

I want to have some floating text in my project, and I found AdvancedDynamicTexture.CreateForMesh to do this with. I made the following proof of concept and copy pasted that into my react native application.

> **[Babylon.js Playground](https://playground.babylonjs.com/#LA6EJF)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Unfortunately it doesn’t show up there, any idea why? I also tried the DynamicTexture, which also works in the playground but not on a device.

I’ve got these versions:  
“@babylonjs/core”: “5.0.0-alpha.65”,  
“@babylonjs/gui”: “5.0.0-alpha.65”,  
“@babylonjs/react-native”: “0.4.0-alpha.47”,

Thanks!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [March 15, 2022, 4:39pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446/2 "2022-03-15T16:39:52Z")

</div>

Adding @Cedric about the babylon gui in native as I can not remember the current set of limitations. I think one of the main one is to load a font in the system ?

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 15, 2022, 4:46pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446/3 "2022-03-15T16:46:36Z")

</div>

You need to load a .TTF font before using it with BabylonNative/ReactNative.

See this thread for more infos : [Dynamic Textures in glb model - #16 by Cedric](https://forum.babylonjs.com/t/dynamic-textures-in-glb-model/25798/16)

---

<div class="post-metadata">

**Author:** ![HedwigAR](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/hedwigar/32/33214_2.png) [@HedwigAR](https://forum.babylonjs.com/u/HedwigAR)\
**Post date:** [March 15, 2022, 7:51pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446/4 "2022-03-15T19:51:14Z")

</div>

Ah, I thought I might be missing something. Thanks!

---

<div class="post-metadata">

**Author:** ![HedwigAR](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/hedwigar/32/33214_2.png) [@HedwigAR](https://forum.babylonjs.com/u/HedwigAR)\
**Post date:** [March 29, 2022, 10:33am UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446/5 "2022-03-29T10:33:32Z")

</div>

Hi! I unfortunately got ill before I could test it all out. The thread you linked helped, the implementation shared by Alex there does work. I can’t make it work with `AdvancedDynamicTexture` though, I only see a small square with what seems like either all the text on top of eachother, or just some random stuff. The square is the size of a single character.  
Here’s the implementation copied to a playground:

> **[Babylon.js Playground](https://playground.babylonjs.com/#BMVVEI)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

I also don’t seem to be able to change the fontsize using `DynamicTexture`. I found here:

> **[Babylon.js Playground](https://playground.babylonjs.com/#5ZCGRM%232)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

that I should put the fontsize in the `font` string, but it doesn’t seem to get picked up.  
Is this because it’s still being worked on? If possible, I’d like to be able to work with `AdvancedDynamicTexture` since I can then use `TextBlock` for the formatting of text.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 29, 2022, 2:38pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446/6 "2022-03-29T14:38:19Z")

</div>

A quick test I’ve just done in Babylon Native:

with `var font = "bold 88px monospace";`

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/b/2b5b4cddaabe446d3448bebae89aaf54a5f41b42.png)

with `var font = “bold 44px monospace”;

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/8/280e6f657cb94d1ce952a00d2a0a7dcc5ce32226.png)

And the script I did:

```auto

var textureGround;
var font = "bold 44px monospace";
BABYLON.Tools.LoadFile("https://raw.githubusercontent.com/CedricGuillemet/dump/master/droidsans.ttf", (data) => {
    _native.Canvas.loadTTFAsync("droidsans", data);

    var ground = BABYLON.MeshBuilder.CreateGround("ground1", { width: 1, height: 1, subdivisions: 2 }, scene);
    ground.rotation.x = -Math.PI * 0.5;
    ground.position.z = 2;

    //Create dynamic texture
    var textureResolution = 512;
    textureGround = new BABYLON.DynamicTexture("dynamic texture", textureResolution, scene);

    var materialGround = new BABYLON.StandardMaterial("Mat", scene);
    materialGround.diffuseTexture = textureGround;
    ground.material = materialGround;
    materialGround.backFaceCulling = false;

    textureGround.clear();
    textureGround.drawText("BabylonNative", 0, 246, font, "White", null, true, true);
    
}, undefined, undefined, true);

```

---

<div class="post-metadata">

**Author:** ![HedwigAR](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/hedwigar/32/33214_2.png) [@HedwigAR](https://forum.babylonjs.com/u/HedwigAR)\
**Post date:** [March 29, 2022, 3:24pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446/7 "2022-03-29T15:24:59Z")

</div>

Hi!

Thank you so much for checking, I think I might have gotten it wrong with setting the font then, I put the font name there instead of ‘bold’. Sorry about that.

One more question, how do I turn the background of the texture clear, like transparent?

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [March 29, 2022, 3:34pm UTC](https://forum.babylonjs.com/t/advanceddynamictexture-createformesh-not-showing-up-in-babylon-react-native/28446/8 "2022-03-29T15:34:31Z")

</div>

You need 2 things, well mostly 1 actually.  
You need to create a transparent material and use the dynamic texture as the diffuse. it how the quad is rendered that determines if it’s transparent or not. not just the texture itself.
