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 47 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. 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.
  3. 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);
  4. 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?
  5. 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
  6. 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.
  7. 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
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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
  13. 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?
  14. 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
  15. 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.
  16. 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 .
  17. 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?
  18. 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
  19. 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
  20. Good morning, I've been trying to load a video on my load.js file, from the assets folder using: preload: function(){game.load.video('backMenu', 'assets/backMenu.mp4');} Like they do here: http://phaser.io/examples/v2/loader/load-video But it doesn't work. The console throws the error: Uncaught TypeError: this.game.load.video is not a function I'm using Phaser 2.4.7, any ideas what could it be? Thanks.
  21. 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!
  22. 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
  23. 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.
  24. 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") {//this.map.tilesets[2].setImage(this.game.cache.getImage("gamesrodekdom"));tilex = this.backgroundlayer.getTileX(this.game.input.activePointer.worldX);tiley = this.backgroundlayer.getTileY(this.game.input.activePointer.worldY);idtile = 518;layer = "backgroundLayer";this.map.putTile(idtile, tilex, tiley, this.backgroundLayer)this.wyslijdanemapa();console.log(przedmiotwybrany);}else if (przedmiotwybrany == "siekiera"){tilex = this.backgroundlayer.getTileX(this.game.input.activePointer.worldX);tiley = this.backgroundlayer.getTileY(this.game.input.activePointer.worldY);idtile = 171;layer = "backgroundLayer2";this.map.putTile(idtile, tilex, tiley, this.backgroundLayer2)this.wyslijdanemapa();console.log(przedmiotwybrany);}else{tilex = this.backgroundlayer.getTileX(this.game.input.activePointer.worldX);tiley = this.backgroundlayer.getTileY(this.game.input.activePointer.worldY);idtile = 812;layer = "blockedLayer";this.map.putTile(idtile, 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]; this.map.putTile(iidtile, ttilex, ttiley, llayer) } }Anyone have idea why? Greets.
  25. 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.