• Content Count

  • Joined

  • Last visited

About Satiana

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hey! I will just link the relevant code and then ask the question (ignore the material parameter, is from an older build still have to get rid of it): function GenerateRandomObject(scene, material){ var nekej = BABYLON.Mesh.CreateBox("box1", 1, scene); nekej.position = new BABYLON.Vector3(getRandom(8, 90, true), 0.5, 90); nekej.rotation.y = getRandom(0, 360, true); nekej.isVisible = false; BABYLON.SceneLoader.ImportMesh("", "_resources/", "Drevo2.babylon", scene, function (newMeshes, particleSystems) { newMeshes[0].parent = nekej; }); return nekej; } So this is the way I create every new instance of a background object. This happens about 0.5 - 2 times every second for this type of object. More with others that I create with similar functions just different imported meshes. So my question is if there is a better way to import/use an imported mesh so i would not need to import the same mesh over and over again every single time i create a new object with that mesh. Thank you very much for any answers you might provide, with best regards, Satiana
  2. Yeah i did, but it doesnt work. Im guessing that BABYLON.Text2d("x", {**THIS HERE**}) is not a part of actual looks more like a css class or something... Not sure what to do
  3. Btw does anyone know how to change the color of the text? i tried fill and color and nothing works. my code looks like this: var canvas = new BABYLON.ScreenSpaceCanvas2D(scene, { id: "ScreenCanvas", children: [ new BABYLON.Text2D("x", { id: "text", marginAlignment: "h: right, v:top", marginRight: 40, marginTop: 40, fontName: "20pt Arial", color: "black", }) ] }); Thank you so much guyz! You are amazing
  4. @jpdev ur a f*** GOD! Thank you sooooo much, suck a simple and functional solution! I cant thank you enough, I LOVE YOU
  5. HEY! Guyz, this is so very confusing to me. All i want is to display a single string in one of the corners of the screen. With it i would display my score. So basicly what i would like to display is something like: var textToDisplay = "Score: " + gameScore; All the answers that i found (been working on this for few hours) were very confusing and basicly useless. I did find dynamicTexture.drawText and got it to work, but it had a few problems: -the text moved with camera (didnt stay in the corner), im guessing it has something to do with the renderingPlane. -the text didnt rewrite all the time so "Score: " is writen OK but the numbers just get writen atop of eachother, and after picking up the 1st coin its just a mess. Could you give me some pointers on how to solve this problem? Thank you very much! Satiana