Search the Community
Showing results for tags 'capacity'.
-
Hey everyone I just have two simple question I cannot find an answer too. First Question: The SpriteManager needs a capacity parameter, but why does it need this? Why can I not change this during runtime? What does it actually do (in the background) (except for just not showing any sprites that exceed the capacity)? Does it hurt performance at all if I just put a 'crazy' high number? Can the manager not just +1 the capacity by itself in the background whenever an instance of the sprite is created? It just seems so odd that I have to give it a number and I feel like I'm missing something here. My second question is how to exactly use the AssetsManager for sprites. The documentation gives this example: var imageTask = assetsManager.addImageTask("image task", "img.jpg"); imageTask.onSuccess = function(task) { console.log(task.image.width); } But that doesn't explain how to use it with a Sprite since the task returns an image, and a SpriteManager only requires an image url. Thank you in advance!
- 1 reply
-
- assets
- assetsmanager
-
(and 5 more)
Tagged with:
-
Hey, I was wandering if anyone knew the code to set the size of sprites to however many pixels as currently no matter what the cell size or image size they are all formatting to the same height which is very unhelpful for my project! Looking for any working solution so I can have height accurate sprites, my two pieces of code being used to position and call in my sprites are as follows; var spriteManagerstaffs = new BABYLON.SpriteManager("peopleManager", "Images/TinyPNG/David.png", 1, 1010, scene); //finds file, sets capacity to 1, cellsize to 1010<-- (does nothing) and adds to scene var staff = new BABYLON.Sprite("staff", spriteManagerstaffs); staff.position.x = -1.4; staff.position.z = 0; staff.isPickable = true; //Sets the position within my 3d environment