# Why Is My Dynamic Text Texture Got Flipped Horizontally? Also How To Make It Transparent?

**URL:** <https://forum.babylonjs.com/t/why-is-my-dynamic-text-texture-got-flipped-horizontally-also-how-to-make-it-transparent/11247>\
**Category:** Questions\
**Tags:** blender, material\
**Created:** [May 29, 2020, 6:46am UTC](https://forum.babylonjs.com/t/why-is-my-dynamic-text-texture-got-flipped-horizontally-also-how-to-make-it-transparent/11247 "2020-05-29T06:46:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlvinStefanus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alvinstefanus/32/7475_2.png) [@AlvinStefanus](https://forum.babylonjs.com/u/AlvinStefanus)\
**Post date:** [May 29, 2020, 6:46am UTC](https://forum.babylonjs.com/t/why-is-my-dynamic-text-texture-got-flipped-horizontally-also-how-to-make-it-transparent/11247/1 "2020-05-29T06:46:10Z")

</div>

Im using dynamic texture to create a text and apply it into a texture. My problem is the text got inverted.

 ![Untitled](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/3/313fd1d6f823c66c3b7e70dde3b0269dab459c05.png)

If I change the uScale = -1, the text is gone.

Also how to make the background transparent?

Here is my code:

```
	function createBackTextTexture(material, scene, text, textureName)
	{
		//Set width an height for plane
		var planeWidth = 10;
		var planeHeight = 3;
	
		//Set width and height for dynamic texture using same multiplier
		var DTWidth = planeWidth * 60;
		var DTHeight = planeHeight * 60;
	
		var tex = new BABYLON.DynamicTexture(textureName, {width:512, height:256}, scene);
		var ctx = tex.getContext();
		
		var font_type = "monospace";
		var size = 12; //any value will work
		ctx.font = size + "px " + font_type;
		var textWidth = ctx.measureText(text).width;
		
		//Calculate ratio of text width to size of font used
		var ratio = textWidth/size;

		//set font to be actually used to write text on dynamic texture
		var font_size = Math.floor(DTWidth / (ratio * 1)); //size of multiplier (1) can be adjusted, increase for smaller text
		var font = font_size + "px " + font_type;			
		
		tex.drawText(text, null, null, font, "green", "white", true);
		
		logMat.diffuseTexture = tex;
	}

		createBackTextTexture(logMat, scene, "TEXT", "text_back");
```

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [May 29, 2020, 11:26am UTC](https://forum.babylonjs.com/t/why-is-my-dynamic-text-texture-got-flipped-horizontally-also-how-to-make-it-transparent/11247/2 "2020-05-29T11:26:18Z")

</div>

Hi @AlvinStefanus and welcome to the forum.

Here is a PG with a dynamicTexture with transparent background [https://www.babylonjs-playground.com/#TMHF80#10](https://www.babylonjs-playground.com/#TMHF80#10)

For mirrored text I am making an assumption that the model is imported from an app that uses a right handed system rather than the left handed system that Babylon.js uses.

Line 4 in this PG shows a possible solution [https://www.babylonjs-playground.com/#TMHF80#141](https://www.babylonjs-playground.com/#TMHF80#141) if my assumption is correct.

---

<div class="post-metadata">

**Author:** ![AlvinStefanus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alvinstefanus/32/7475_2.png) [@AlvinStefanus](https://forum.babylonjs.com/u/AlvinStefanus)\
**Post date:** [May 30, 2020, 2:25am UTC](https://forum.babylonjs.com/t/why-is-my-dynamic-text-texture-got-flipped-horizontally-also-how-to-make-it-transparent/11247/3 "2020-05-30T02:25:08Z")

</div>

Hello @JohnK,

Thank you for the response.

I use Blender to make the object. If I put:

```
scene.useRightHandedSystem = true;

```

the textures become all black. What is happening here?

![Untitled2](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/9/9afdac12b714a25d5eae11c5eeaa397f3ee4d3e5.png)

---

<div class="post-metadata">

**Author:** ![AlvinStefanus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alvinstefanus/32/7475_2.png) [@AlvinStefanus](https://forum.babylonjs.com/u/AlvinStefanus)\
**Post date:** [May 30, 2020, 2:30am UTC](https://forum.babylonjs.com/t/why-is-my-dynamic-text-texture-got-flipped-horizontally-also-how-to-make-it-transparent/11247/4 "2020-05-30T02:30:28Z")

</div>

Also I got a lot of unhandled exceptions with and without `useRightHandedSystem = true`

 ![Untitled1](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/a/a2c5dff06dcbb7cba15d93cc5b91a01d7ff5a3ad.png)

---

<div class="post-metadata">

**Author:** ![AlvinStefanus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alvinstefanus/32/7475_2.png) [@AlvinStefanus](https://forum.babylonjs.com/u/AlvinStefanus)\
**Post date:** [May 30, 2020, 3:39am UTC](https://forum.babylonjs.com/t/why-is-my-dynamic-text-texture-got-flipped-horizontally-also-how-to-make-it-transparent/11247/6 "2020-05-30T03:39:39Z")

</div>

Nvm, I just played around with my blender model. Apparently I have to do some rotations to the text container, finally I got it right, thank you.
