Search the Community

Showing results for tags 'file'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 8 results

  1. or Hire is playground which doesn't work ok any more or How can I load my .babylon file from dropbox or my server? This code has worked. What is goging on now? I see with F12 new problem XMLHttpRequest cannot load No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access. But this things has worked before. How can I make this example to work again? Any alternatives? (I also try like this set data (copy/paste from .babylon file) but here is problem with string of data ! I try \" and \' also but no luck.) I would like to make some playground to ask something and I can't meke playground to load .bayblon file. Greetings Ian
  2. Hi! I've been using Babylon for a week or so now and really like how easy it is to use and how well the tutorials are written (I'm using it for a robotics simulation project I'm currently working on). Anyways, I have a question about how textures (and other AssetTasks as well: are loaded using the AssetManager. I have a texture image that's being served at /app/assets/sceneassets/mytextureimg.jpg. My Babylon scene is loaded at the url /app/testbabylon. When I try to load a texture using the addTextureTask method of the AssetManager, I specify that the asset is located at "/app/assets/sceneassets/mytextureimg.jpg", however, the network request that the AssetManager makes is to "/app/testbabylon/app/assets/sceneassets/mytextureimg.jpg". This is clearly relative to my current path, I can use an absolute path (in dev: "http://localhost:4000/app/assets/sceneassets/mytextureimg.jpg") and it works correctly, however this seems messy (especially if switching domains). If I end up using "//app/assets/sceneassets/mytextureimg.jpg" the network request is "http://app/assets/sceneassets/mytextureimg.jpg" - which doesn't point to anything. My main question is whether its possible to specify the AssetManager to use the root url of my domain for texture (and/or image, cubetexture, etc.) loading (or have something like a "rootUrl" parameter like AddMeshTask seems to have). Just for reference, here's a snippet of the code I'm using (material is an object that has a name and diffuseTexture property; where diffuseTexture is the url string, scene is a Babylon Scene object). setupMaterial(material, scene) { const babylonMaterial = new Babylon.StandardMaterial(, scene); if (material.diffuseTexture) { const diffuseTask = scene.loader.addTextureTask( `diffuseTextureTask${}`, material.diffuseTexture); diffuseTask.onSuccess = (task) => { babylonMaterial.diffuseTexture = task.texture; }; } return babylonMaterial; } Thanks for any help, Flux159
  3. Hi guys. I'm back in bussiness :)) And I have a new nightmare. So let me explain.... I have a babylonjs file, around of 10mb, It has 5mb without animation, and with one animation it have 10mb. Now a have to add 4 more animations on it, so it's not too good:). On Edge or Chrome it's loading fast, but using browsers like mozilla and safari, i'm asleeping. So I tested all the exporters, and 3dsmax, without "Do not optimize animations" checked, and with "Try to optimize vertices" checked, export the smallest file. But what I can remove more, because, it is still too big, and it has only 65k vertices. Thanks a lot.
  4. Hello, I'm migrating my index.html phaser code to different javascript files for better structure and organisation; but I'm coming upon a problem. I've decided to use the template to make the game responsive "Basic Responsive Template" The templates features different states: boot, preload, game, and mainmenu as js files. I load all these in my HTML file and proceed to start from the "game" state. using a button I created in "Mainmenu". In the "create" method, of the "game" state, I call the createButtons function. This function is stored in another JS file that is loaded in the HTML file, before loading the phaser states. here is the createButtons code : function createButtons(){ //Mountain Brush buttonGroup =; buttonMountain = this.add.button(736, 32, 'buttons', mountainOnClick, this, "mountainbutton0.png","mountainbuttonpush.png", "mountainbuttonpush.png"); buttonMountain.fixedToCamera = true; buttonGroup.add(buttonMountain) function mountainOnClick () { currentLayer = terrainPop; currentTile = 5; } In the "game" state here is the code I use to call createButtons create: function () { //========================== WORLD CREATION //Make our game world and set it bounds, 0, gameWorldX*32, gameWorldY*32); // ========================== TERRAIN CREATION //create Blank tilemap terrainLayer = this.add.tilemap(); // add a tileset Image to the map terrainLayer.addTilesetImage(tileSetImage); //create the world as a layer terrain = terrainLayer.create('level1', gameWorldX, gameWorldY, 32, 32); terrainPop = terrainLayer.createBlankLayer('level2', gameWorldX,gameWorldY,32,32) terrainLimbo = terrainLayer.createBlankLayer('limbo', gameWorldX,gameWorldY,32,32) // Fills tilemap layer with default tile:HOLY WATER (6) terrainLayer.fill(0, 0,0,gameWorldX,gameWorldY, 'level1'); //allows camera to move around terrainLayer.fixedToCamera = false; currentLayer = terrain; createButtons(); },// End of Create When trying to load the state, I get the error: "TypeError : this.add is undefined" on the createButtons.js:3:1; I don't understand why createButtons isn't working in the scope of the create method I've been beating my head at this all day long and couldn't find any solution; i'm pretty sure it's a noobie mistake and would be grateful for some help! Thanks a lot
  5. I'm using AssetsManager to load a list of files. Is there a way to tell a loaded file's size? e.g. by the IAssetTask returned onTaskSuccess. I'd like to avoid using SceneLoader as I'd need to create predefined .babylon files to load, and I'd like to avoid that. (assuming I understand SceneLoader properly)
  6. Hello, I have a problem with load animation from two files to one obecjt. Load files to the game: this.load.spritesheet('cowwalk', 'assets/images/animal/cow_walk.png',128,128); this.load.spritesheet('coweat', 'assets/images/animal/cow_eat.png',128,128); Create object from file cowwalk: this.cow =this.animal.create(zwierzex, zwierzey, 'cowwalk'); Adding animation to object: this.cow.animations.add('cowleft',[7,6,5,4]); this.cow.animations.add('cowright', [12, 13, 14, 15]); this.cow.animations.add('cowdown', [8, 9, 10, 11]); this.cow.animations.add('cowup', [0, 1, 2, 3]); this.cow.animations.add('coweatleft', [7,6,5,4]); this.cow.animations.add('coweatright', [12, 13, 14, 15]); this.cow.animations.add('coweatdown', [8, 9, 10, 11]); this.cow.animations.add('coweatup', [0, 1, 2, 3]); Animation walk i going well, but please tell my now, how to add animation coweat to the object, and them chose wich animation shoud be play? I must create animal from obect coweat or what? Maybe i should to compile two files to one and them add? Please give me some ideas
  7. Is there a limit to the size of a babylon file? I am in the 270MB range and it appears that the file is not loading. It is really large because there is a great deal of animation in the file. Have I reached the limit?
  8. Hi, For one of my project, I need to export a scene from the browser to a file. My goal is to write a custom babylon importer for another engine (a mobile engine). My importer is already done and now I need to export scenes from Babylon. Can I do this easily ? (maybe there are a super functions I missed ?) Thanks for your answers Yann. Edit: Ok I just seen SceneSerializer, it's awesome \o/ var serializedScene = BABYLON.SceneSerializer.Serialize(scene);var strScene = JSON.stringify(serializedScene);