Search the Community

Showing results for tags 'load'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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 53 results

  1. Hi community, I want to propose you some addition to assetManager and sceneOptimizer. If the solution already exist, said me assetManager : 1. Get loading percent, not on x file loaded but on stream data loaded when it's possible. > for more precision and to show state if you load some big files. 2. Add "abort" function and "onAbort" callback to cancel running tasks and loading files. > Currently "clean" function delete tasks in assetManager but not abort current loads. That mean if you have a big file in loading, it don't stop. sceneOptimizer : 1. Add a starter level to try optimizing render : > I tested the current sceneOptimizer and the problem is it try the best render first. If you have an older device, the website crash and the browser reload page before that sceneOptimizer can downgrade the render. So, it's a loop without ending. 2. Create two steps to optimize render : > First : upgrading. The sceneOptimizer try to reach "x" FPS with the starter level. If it's ok, it upgrade render again until when it can't reach "x" FPS. > Second : dowgrading. If the last try (or the first try with the starter level ) not reach FPS, the sceneOptimizer downgrade until when it can reach FPS. If the sceneOptimizer reach "x" FPS, it stop. > Of course, we keep "trackerDuration" : time in milliseconds between passes. > You will can restart the sceneOptimizer when you add or change something like the current version What do you think about this ? Have a nice day !
  2. Hi, I've got a problem with loading scene with .babylon extension. I making project in .NET Core with BabylonJS addon and I got a problem with this script: // Get the canvas element from our HTML below var canvas = document.querySelector("#renderCanvas"); // Load the BABYLON 3D engine var engine = new BABYLON.Engine(canvas, true); // ------------------------------------------------------------- engine.enableOfflineSupport = false; var scene = new BABYLON.Scene(engine); BABYLON.SceneLoader.Load("./js/", "babilon_blender.babylon", engine, function(newScene){ var scene = newScene; scene.executeWhenReady(function(){ scene.activeCamera.attachControl(canvas); engine.runRenderLoop(function(){ scene.render(); }); }); }); Page is build and start loading scene, but this is over. Neverending loading with Babylon mark. Could someone help me and advice what should I do to make a load scene properly? Thanks for help
  3. Hey. I have a 20 MB babylon file on my server right now. I don't want my server to compress it every time. Instead I'd like to put a babylon.gz on my server and load the babylon file. Is that possible? I've tried to change the filename in the SceneLoader to "test.gz" instead of "test.babylon" but that didn't work..
  4. 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!
  5. Hi all. I'm trying to return an array of objects loaded by the Mesh Importer for later use. I would like to be able to call a function to load my objects and outside of the function, affect & change each one of them OUTSIDE of the function. Here is the small demo I made :: http://www.babylonjs-playground.com/#1QJUDF#3 Thank you! <3 Mythros
  6. Hi, Looking around for a lazy-loading mesh example. There is assetManager and sceneLoader, with ImportMesh, .append() and .load() variations. All good there. : ) Question: Which way is best to delay-load (lazy-load) 3D meshes? The original hope was for AssetManager to be able to delay-load. Does it? - Looking for something like runTask, after init, but then found ._runTask, so maybe delay not possible. Did I miss it? Idk. : ) 2) Next, sceneLoader.append, can it lazy-load? Couldn't find example.... 3) ImportMesh, my previous favorite way, but recently standardized around AssetManager, and hesitant to switch. etc. Which is best to lazy-load? Thanks,
  7. Hello. I don't understand the following thing. I created a Cube in Blender without any material or texture, just the Cube itself, no light, no camera. Then I exported the Cube. The Cube's name is "car" or "Blender car". Then I loaded it into Babylon. Then I applied babylon's StandartMaterial and diffuseColor to the Cube. But, before that, I created a Box mesh in Babylon itself and applied StandartMaterial and diffuseColor to the Box. The DiffuseColor is exactly the same in both the Blender Cube ("Blender car") and the Babylon Box. BUT, they look DIFFERENT !!! WHY ??? Could anybody make the Blender Cube ("Blender car") look exactly the same as the Babylon Box. Because, I applied the Babylon's StandartMaterial and DiffuseColor. to the blender's Cube. Here is the link to the html file with babylon - http://webnurlan3d.uphero.com/rotationradians.html And the html file itself - https://cloud.mail.ru/public/M2H3/TtvbFWRqx Thank you.
  8. I'm working on a small card game and I'd like to make an array of sprites to make the code more readable. What I mean is I have hearts,spades,clubs and diamonds and I'd like each to be its own array when I load my images from my assets. Below is similar to what I have: PIXI.Loader .add("hearts10","hearts10.png") .add("hearts9","hearts9.png") ... .load(start) I'd like to be able to access the cards via an array of arrays, sort of like: var current_card = new Sprite(resources.cards.hearts.10.texture);
  9. I am trying to load a texture atlas into the app when the user clicks on the canvas. 2 things happen on canvas click: 1. the animation already loaded plays, and 2. I fetch a new texture atlas from server. Newly fetched texture atlas plays on the next canvas click, and a new texture atlas is fetched. Think of it as endless loop. On every click, previously loaded animation is played, and the next one is fetched and repeat. It is absolutely essential that there is no freeze between animating. What approach do you recommend I take? My tests showed that there is some issues with dynamically loaded texture atlases - animation freezes, if texture atlas is being loaded at the same time. The issue really shows on mobile devices. I've got a hunch that there might be a problem that both PIXI.loader and object.gotoAndPlay() use the main thread, and they block each other, but I really don't know that much about Pixi. I've posted a similar question earlier today: , but I think I didn't correctly identify the reason for my bad performance. So this question is more in general terms. What is the best way to run texture atlas animation and load another texture atlas at the same time, so that the animation can run without any delay when wanted?
  10. https://www.dropbox.com/s/l2l67aququd7she/Patch.babylon?dl=0 or https://ajna4taiga.no-ip.org/BabylonBall/Patch.babylon Hire is playground which doesn't work ok any more http://www.babylonjs-playground.com/#CKEHJ#1 or http://www.babylonjs-playground.com/#CKEHJ#3 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 https://ajna4taiga.no-ip.org/BabylonBall/Patch.babylon. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.babylonjs-playground.com' 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 http://www.babylonjs-playground.com/#YEKUO#1 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
  11. Load text before load game

    I have a code like this: fonts.css @font-face{ font-family: 'LiberationMono'; src: url('../fonts/LiberationMono-Regular-webfont.eot'); src: url('../fonts/LiberationMono-Regular-webfont.eot?iefix') format('eot'), url('../fonts/LiberationMono-Regular-webfont.woff') format('woff'), url('../fonts/LiberationMono-Regular-webfont.ttf') format('truetype'), url('../fonts/LiberationMono-Regular-webfont.svg#webfont') format('svg'); } @font-face { font-family: 'archivoblackregular'; src: url('../fonts/archivoblack-regular-webfont.woff2') format('woff2'), url('../fonts/archivoblack-regular-webfont.woff') format('woff'), url('../fonts/ArchivoBlack-Regular.ttf') format('truetype'); } fonts = "30pt LiberationMono"; fontTitles = "50pt archivoblackregular"; ... text = this.game.add.text(this.game.world.centerX, 130, "¿What option is the correct?", { font: fontTitles, fill: "#005ba6", align: "center" }); text.anchor.set(0.5) But in the first round does not work. I have thought to use this as it says in https://hacks.mozilla.org/2016/06/webfont-preloading-for-html5-games/ var fontLoaded = false; var gameCreated = false; function createText() { if (!fontLoaded || !gameCreated) return; game.add.text(0, 0, 'Lorem ipsum', { font: '12px Amatica SC', fill: '#fff' }); } function preload() { let font = new FontFaceObserver('Amatica SC'); font.load().then(function () { fontLoaded = true; createText(); }); } function create() { gameCreated = true; createText(); } But it's a lot of code change, since my games are all with text. Thanks in advance.
  12. Load assets asynchronously

    Hi, To make the preload faster, I need to load several assets after the preload phase, and use then when they has been loaded. To do that, I've used the Phaser.Loader object and register to "onFileComplete" Phaser.Signal to catch the file when has been loaded, to load the next file. This works well until I need to change the current state and there are an asset being loaded. When the file is loaded and the new state has been created, Phaser detects that the Loader is not loading (processLoadQueue method from Phaser.loader) and shows this message: 'Phaser.Loader - active loading canceled / reset', and the "onFileComplete" registered functions, are not fired, and I cannot continue loading more assets. My idea was to attach to "onStateChange" signal and stop/pause the current async download, but there are no public methods in Phaser.Loader to do that. Are there a good way to load assets asynchronously with state changes? Thanks
  13. Load textures synchronously

    Is there anyway to load textures in pixi synchronously? Something like: var texture = PIXI.Texture.fromImage("bunny.png", onComplete);function onComplete() { var bunny = new PIXI.Sprite(texture);}I tried the following: var img = new Image();img.onload = onComplete;img.src = 'bunny.png';function onComplete() { var texture = new PIXI.Texture(new PIXI.BaseTexture(img));}But the code above gives me an error. Please let me know how I can make pixi work synchronously. Thank you in advance. EDIT: I also tried: http://jsfiddle.net/8MawM/ but, it also gives me an error.
  14. Hello: I downloaded a city model(fbx) from sketchfab (https://sketchfab.com/models/d60778fd8b8f4f5e9ce20f0bc506eaeb). Then, I exported babylon file through unity3d , but in the babylonjs engine is not loaded, not show error . I thought the model was too big (babylon file 80mb). However, I used the tools (https://github.com/BabylonJS/Babylon.js/tree/master/Tools/MakeIncremental) segmentation babylon file. After incremental load loading, it is still not success, not show any error. I suspect that loading is not success because the model is generated with the cityengine, but my suspicions are unfounded.
  15. I am a beginner at phaser trying to create a game that all of the sprites will be generated through bitmapdata. However, I always have to refresh browser twice to see the sprites. Like in the phaser example on generating a sprite: http://phaser.io/examples/v2/create/generate-sprite You won't see the sprite till you refresh. My questions are the following friends: What needs to be done to have all the bmd sprites generated the first load? (Will I have to create a loader, do something with cache?) If developing a multiplayer game with bmd sprites will some problem persist? Thank you for your time and I hope you can help me wrestle with understanding phaser.
  16. game.load.shader is not a function?

    Hey guys, total Phaser noob here. I'm interested in doing shaders in Phaser, and looking at this example : http://phaser.io/examples/v2/filters/bacteria#comments I should be able to use : game.load.shader('bacteria', 'assets/shaders/bacteria.frag'); to get my fragment shader loaded but I get a "Uncaught TypeError: game.load.shader is not a function" Anyone ever encountered this issue? Looking in the docs it seems that load.shader is not even available. So I'm a bit confused as to why it is present on Phaser's official website.
  17. hi i wanna check image(basetexture) loaded that load by altas... pixi call like under code var atlas_url = "data/packed/map_object.atlas"; PIXI.loader.add(map_name, atlas_url).load(onAssetsLoaded); // use callback var scope = this; function onAssetsLoaded(loader, res) { .... } i can't check basetexture loaded. how can i check loaded done..? thx
  18. Is this an efficient way to load sprites?

    var mySpriteSheetImage = PIXI.BaseTexture.fromImage("img/mySpriteSheet.png"); var spriteTexture1 = new PIXI.Texture(mySpriteSheetImage, new PIXI.Rectangle(x:0, y:0, width:32, height:32)); var spriteTexture2 = new PIXI.Texture(mySpriteSheetImage, new PIXI.Rectangle(x:32, y:0, width:32, height:32)); var spriteTexture3 = new PIXI.Texture(mySpriteSheetImage, new PIXI.Rectangle(x:64, y:0, width:32, height:32)); var mySprite = new PIXI.Sprite(spriteTexture1); stage.addChild(mySprite); The code above loads many sprites from a sprite sheet. This code was found here. Is there a better way to get the same functionality?
  19. Hi guys, I am working on an auto-update system for my project. I use Cordova to make Android build. The update system will check and download new files to cdvfile://localhost/persistent/app/ location. For example: "cdvfile://localhost/persistent/app/img/cat.png". Is there a way that I can load images from this folder, such as "game.load.image('cat', 'cdvfile://localhost/persistent/app/img/cat.png');"? So that I can use the new image instead of the old one. I know that this file is not on the server so I don't think I can set up 'Access-Control-Allow-Origin. Is that possible for me to load file from a location like that? What can I do if it is impossible for me? Bare with my English grammar. If you are confused about what I am asking, just leave a message. Thank you very much! Young
  20. In my game I want a single tilemap loaded for each room as the player enters them. I made a function that loads a tilemap, where the name of it is the parameter: new_room: function(name) { this.load.tilemap(name, 'assets/tile/' + name + '.json', null, Phaser.Tilemap.TILED_JSON); map = this.game.add.tilemap(name); foreground = map.createLayer('foreground'); map.setCollisionBetween(1, 100000, true, 'foreground'); },The name of the tilemap I'm trying to load is "second", but it's not working: "Phaser.Cache.getTilemapData: Invalid key: "second"" phaser.min.js:16"Phaser.TilemapParser.parse - No map data found for key second" phaser.min.js:20I feel like there could be some feature in Phaser that does what I'm trying to do. I'm not familiar with dynamically loading things.
  21. Hi , I start a few weeks ago with Phaser and I have some problems that I couldn't find a solution yet so what I actually want to do is this: I want where a "load bar" is loaded to se a background image instead of solid color so my code is : /* BOOT SIDE */ var boot = function ( game ) { }; boot.prototype = { init : function () { } , preload : function () { this.game.stage.backgroundColor = "#6cb2f3"; this.game.load.image ( 'loader' , 'sprites/images/loader.png' ); } , create : function () { // Set background for our game this.game.state.start ( "Preload" ); } }; /* PRELOAD SIDE */ var preload = function ( game ) { }; preload.prototype = { preload : function () { // the other assets ... this.game.load.image ( 'background' , 'sprites/images/background.png' ); this.preloadBar = this.add.sprite( 150, 550, 'loader'); this.load.setPreloadSprite(this.preloadBar); } , create : function () { console.log ( "Load the preloader .." ); this.game.state.start ( "GameStart" ); } }; The loader image is working same as background color but instead of a background color i want to load an a image . thanks .
  22. Problem with loading tilemap

    Hello, I have a problem with loading JSON file on my game to make a world. This is a files: https://www.sendspace.com/file/icmjbs What is the problem??? How to fix this problem?
  23. hi. ios is failed to load basetexture with many basetextures more than 5-10. and baseteuxtres size(capacity) is not small. it is big than 500kb have you every happened this on ios? thx.. best regards https://github.com/pixijs/pixi.js/issues/2758 Wrong shot that failed to load baseteuxtre Good shot that loaded basetexture
  24. Hi guys I have the Problem, that one of my Spritesheets wont load, as android app in Cordova. But every other images, sheets and other data work. It also works fine in firefox and Chrome. I tested the Cordova build on my Galaxy S3. I hope someone know this issue, Dennis