Korvo Posted September 14, 2015 Share Posted September 14, 2015 I am trying to create lines of text on a background that is not square. Think airplane pulling advertising banner. When do something like: var ground = BABYLON.Mesh.CreateGround("ground1", 70, 10, 2, scene);instead of var ground = BABYLON.Mesh.CreateGround("ground1", 70, 70, 2, scene); my text gets smooshed.var groundTexture = new BABYLON.DynamicTexture("dynamic texture", 2048, scene, true);var dynamicMaterial = new BABYLON.StandardMaterial('mat', scene);dynamicMaterial.diffuseTexture = groundTexture;dynamicMaterial.specularColor = new BABYLON.Color3(0, 0, 0);dynamicMaterial.backFaceCulling = false;var ground = BABYLON.Mesh.CreateGround("ground1", 70, 70, 2, scene);ground.material = dynamicMaterial;ground.position = new BABYLON.Vector3(0, 1, -20);var clearColor = "#ffffff";var font = "bold 35px Courier New";var invertY = true;var text = "12345678901234567890123456789012345678901234567890123456789012345678901234567890";var color = "black"var x = 10;var y = 35;var context = groundTexture._context;var size = groundTexture.getSize();context.font = font;context.fillStyle = color;context.fillText(text, x, i*35);groundTexture.update(invertY); Thanks Quote Link to comment Share on other sites More sharing options...
Korvo Posted September 14, 2015 Author Share Posted September 14, 2015 I figured it out. var groundTexture = new BABYLON.DynamicTexture("dynamic texture",{width:70,height:10}, scene, true); Then just make the ground match: var ground = BABYLON.Mesh.CreateGround("ground1", 70, 10, 2, scene); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.