Search the Community

Showing results for tags 'load'.

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 44 results

  1. 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?
  2. 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
  3. 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 =, 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 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.
  4. 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
  5. 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: but, it also gives me an error.
  6. Hello: I downloaded a city model(fbx) from sketchfab ( 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 ( 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.
  7. 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: 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.
  8. Hey guys, total Phaser noob here. I'm interested in doing shaders in Phaser, and looking at this example : 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.
  9. 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
  10. 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?
  11. 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
  12. 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 =; 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.
  13. 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 () { = "#6cb2f3"; ( 'loader' , 'sprites/images/loader.png' ); } , create : function () { // Set background for our game ( "Preload" ); } }; /* PRELOAD SIDE */ var preload = function ( game ) { }; preload.prototype = { preload : function () { // the other assets ... ( '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 .." ); ( "GameStart" ); } }; The loader image is working same as background color but instead of a background color i want to load an a image . thanks .
  14. Hello, I have a problem with loading JSON file on my game to make a world. This is a files: What is the problem??? How to fix this problem?
  15. 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 Wrong shot that failed to load baseteuxtre Good shot that loaded basetexture
  16. 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
  17. Good morning, I've been trying to load a video on my load.js file, from the assets folder using: preload: function(){'backMenu', 'assets/backMenu.mp4');} Like they do here: But it doesn't work. The console throws the error: Uncaught TypeError: is not a function I'm using Phaser 2.4.7, any ideas what could it be? Thanks.
  18. Hi everyone. I am creating a game that consuming an image api. Is it possible to load or change an image outside the preload method? For example, in the create method. I am making a game with a lot of images, and i need to load in game runtime. I tryed to change de cache object, but without hit. Also tryed to use game.load.image, but not run out of preLoad method. Any idea? Thanks!
  19. Hi all, I would like to load the textures for a cubeTexture in different sizes, so that first only a small resolution is loaded and then the normal textures. like LOD I would like to use the assetsManager? var assetsManager = new BABYLON.AssetsManager(scene); var textureTask = assetsManager.addTextureTask("image task", "example/blabla.png");//?url textureTask.onSuccess = function(task) { //my skybox function elsewhere createSkybox(task.texture);// dont work console.log("cubetexture loaded"); } assetsManager.load(); //my skybox function elsewhere createSkybox("example/blabla");// fine
  20. In my application I have animation packages(babylon files) that are very large and take a while to download from the server. This download time is helped by using the enableSceneOffline and enableTexturesOffline in the manifest file, but we still have to deal with the initial load each time. Is there a way to load those so they are available in the background without having to render them on screen until we are ready for the user to interact with them? The load times are excessive for each package, but it would help if I could load a new babylon file to have it ready for when the user is done interacting with the first.
  21. Hi everyone! I have a problem with load tile to the map. In my project when player click on the map, tile.x and tile.y i saveing in data base, and them when i start game tiles are loading to the map. When i load tile when player click, everything is okay, and it is colide with player and added object. if(TopDownGame.level == "ogrod1"){if (przedmiotwybrany == "lopata") {//[2].setImage("gamesrodekdom"));tilex = this.backgroundlayer.getTileX(;tiley = this.backgroundlayer.getTileY(;idtile = 518;layer = "backgroundLayer";, tilex, tiley, this.backgroundLayer)this.wyslijdanemapa();console.log(przedmiotwybrany);}else if (przedmiotwybrany == "siekiera"){tilex = this.backgroundlayer.getTileX(;tiley = this.backgroundlayer.getTileY(;idtile = 171;layer = "backgroundLayer2";, tilex, tiley, this.backgroundLayer2)this.wyslijdanemapa();console.log(przedmiotwybrany);}else{tilex = this.backgroundlayer.getTileX(;tiley = this.backgroundlayer.getTileY(;idtile = 812;layer = "blockedLayer";, tilex, tiley, this.blockedLayer)this.wyslijdanemapa();console.log(przedmiotwybrany);}} But when i restart the game, and them load tile from database they are loaded but issnt collide with player.. if(TopDownGame.level == "ogrod1"){ for (var i = 0; i < Tablicawiersze; i++) { var iidtile = Tablica[i][0]; var ttilex = Tablica[i][1]; var ttiley = Tablica[i][2]; var llayer = Tablica[i][3];, ttilex, ttiley, llayer) } }Anyone have idea why? Greets.
  22. Is there tutorial, what is best way to make level/state change as non-portable way? I mean when level1 is completed, level2 comes direct to after level1, so it changes level without any loading or other fancy things.
  23. I am loading a bunch of texture atlases with many sprites in them, but now, for performance testing I would like to bulge some of these atlases together. Due to my automated gulp tasks this is no issues and only takes a couple of seconds, as to create the new textures, but still all my sprite creation use something like layer.foreground.create(x, y, 'enemies', 'enemy_pig'); which will no longer work if the atlas name has changed. If I combine the two atlases "enemies" and "pickups" into one, all these initialisations will fail. Since I have named the textures within each atlas with an unique key even across the atlases there will be no mixup. So my question is: How do I make phaser detect which atlas a texture-key is from, and is this a built in feature, since it seems obviously useful, or do I have to create my own implementation of detecting the atlas with a function like "findAtlas()" that searches the loaded atlases for a texture like: layer.foreground.create(x, y, findAtlas('enemy_pig').key, 'enemy_pig'); Thanks for any help
  24. Hey there, I have a problem with my imported babylon-mesh. Its not that small, and sometimes if I refresh the site, it is loaded to the half (the balloon loads, the basket not). Thats probably because the basket uses some textures, the balloon not. Is there a way to wait for everything (also textures) to load? Like the spinning circle from a lot of bablyonjs-projects featured on the main site. Here is the project: Thanks! I don't want to seem unthankful, and because of that this small information: I'm not at home from now on till probably tomorrow Thanks for any answers, I'll have a close look tomorrow!
  25. Hi, I was just wondering how, in theory, you could incrementally load part of a scene that is changed in game and saved out? i.e. Load map, build things, save map. I've read the docs and seen that there is a way to do incremental loading, but that is using a piece of software that I won't have on the server. Can I save out the blocks of the scene into a certain json format? Thanks for your help