MinZe Posted October 26, 2018 Share Posted October 26, 2018 Hi, I'm trying use sprites but they are not showing up and no error is displayed. this is the typescript code o.spriteManager = new BABYLON.SpriteManager('circleManager', 'https://i.imgur.com/kzDwQjO.png', 2000, 512, o.scene); o.spriteManager.renderingGroupId = 2; const a = new BABYLON.Sprite('p01Circle ' + options.name, o.spriteManager); // const a.stopAnimation(); // const a.cellIndex = 0; a.width = 100000; a.height = 100000; And in this playground I have almost the same, but it's not working: https://www.babylonjs-playground.com/#9RI8CG#33 (sprites demo playground but with the url changed) this is the code on the playground, this one works var spriteManagerTrees = new BABYLON.SpriteManager("treesManager", "https://i.imgur.com/kzDwQjO.png", 2000, 512, scene); //We create 2000 trees at random positions for (var i = 0; i < 10; i++) { var tree = new BABYLON.Sprite("tree", spriteManagerTrees); tree.position.x = Math.random() * 100 - 50; tree.position.z = Math.random() * 100 - 50; tree.isPickable = true; tree.size = 10; //Some "dead" trees if (Math.round(Math.random() * 5) === 0) { tree.angle = Math.PI * 90 / 180; tree.position.y = -0.3; } } What can I do to solve it? Quote Link to comment Share on other sites More sharing options...
MinZe Posted October 26, 2018 Author Share Posted October 26, 2018 Okay, it seems the problem is on the rendering group. If I comment the // spriteManager.renderingGroupId = 2 it works perfectly. But I really need to be rendered the last thing, I need the sprite to be always over the meshes Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 26, 2018 Share Posted October 26, 2018 Hi @MinZe Sprites are already being rendered on top of meshes. https://www.babylonjs-playground.com/#UBXKZZ Quote Link to comment Share on other sites More sharing options...
MinZe Posted October 28, 2018 Author Share Posted October 28, 2018 It's strange, I snapped an sprite to a mesh, and it seemed as it were overlapping 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.