DylanD Posted July 23, 2018 Share Posted July 23, 2018 Hey everyone I recently started trying to put my webapp made in Babylonjs and typescript into a Cordova android app. Before this I was just setting up a local server, this way I could load all of my assets easily. However when my app gets built for android it makes all of the assets go through this type of path file:///android_asset/www/Audio/ Which I don't believe Babylonjs can handle er something. Except some of the sound files load source: I can hear them but they still give the error. So I was wondering what the next best solution would be, but I don't have my own server to host these assets on, I was thinking GitHub maybe but I don't know how I would reference that in my code. The type of assets I have are babylon scenes, images, textures, and sound files so imgur won't work (I think). Im going to try the GitHub approach for now. They would need to be private so no one but me can see them but I also need them to be accessible to anyone who has the app so I'm kinda stumped about how to do it with that respect... Any ideas ? More details in these posts about my problems: Thanks have a beautiful time! Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 23, 2018 Author Share Posted July 23, 2018 These are some of the way I import things/load things into my scenes (these are just snippets from a much bigger picture) let button = BABYLON.GUI.Button.CreateImageWithCenterTextButton("button","",("textures/model"+ (i*3+k>0? (i*3+k):"")+".png")); BABYLON.SceneLoader.ImportMesh("","./models/","model.babylon",this.scene,(meshes)=>{ importFunc(meshes); }); var materialPlane = new BABYLON.StandardMaterial("texturesPlane",this.menuScene); var backgroundTexture = new BABYLON.Texture("textures/background.png", this.menuScene); Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 23, 2018 Author Share Posted July 23, 2018 I'm really hoping there is a way to do this locally but from what I understand I need to import from some type of server. Is there anyway to get around having to load assets off a server? I think assetManager can do it with text and binary files, even scene files but I cannot use that for making my image only buttons... or can I? Quote Link to comment Share on other sites More sharing options...
Salc2 Posted July 23, 2018 Share Posted July 23, 2018 Hi DylanD, I am pretty sure you can do that without any server. This is not an specific BabylonJs topic but web standards topics. You should find in Cordova documentation where should the assets folder be. I could bet Cordova handles an agnostic assets folder regardless the OS target. This is a very common use case of webapps packaged to "native" so I guess should be easy find something just don't look for specific "Cordova + Babylon js" keywords but JavaScript in general. Maybe this can help: https://stackoverflow.com/a/48341518/1765828 https://github.com/apache/cordova-plugin-file/blob/master/README.md Cheers. JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
DylanD Posted July 23, 2018 Author Share Posted July 23, 2018 25 minutes ago, Salc2 said: Hi DylanD, I am pretty sure you can do that without any server. This is not an specific BabylonJs topic but web standards topics. You should find in Cordova documentation where should the assets folder be. I could bet Cordova handles an agnostic assets folder regardless the OS target. This is a very common use case of webapps packaged to "native" so I guess should be easy find something just don't look for specific "Cordova + Babylon js" keywords but JavaScript in general. Maybe this can help: https://stackoverflow.com/a/48341518/1765828 https://github.com/apache/cordova-plugin-file/blob/master/README.md Cheers. Good idea, I didn't think of that. Im looking into this. Thanks! 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.