Dsarmis

Members
  • Content Count

    6
  • Joined

  • Last visited

  1. Hey @kestrelm Thanks very much for both posts. I will try them today!
  2. Hey @kestrelm, could you please help me a bit more? After a lot of searching i am confused as $#!%$. It will be a big post but i think it will be simple enough to point out some directions Here is the code to create the Creature stuff in stage. var loader = PIXI.loader; var texture = null; var creature_pack = null; var creature_rend; var testImg; var stage = new PIXI.Container(); var renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight); const ticker = new PIXI.ticker.Ticker(); document.body.appendChild(renderer.view); renderer.backgroundColor = 0xffffaa; loader.add({name:"anim_data", url:"p3_setup_character_data.creature_pack", xhrType:"arraybuffer"}) .add({name:"anim_texture", url:"p3_setup_character_img.png"}) .load(createObjects); function createObjects(){ testImg = new PIXI.Sprite(loader.resources.anim_texture.texture); testImg.y=350; testImg.x=150; creature_pack = new CreaturePackLoader(loader.resources.anim_data.data); creature_rend = new CreaturePackRenderer(creature_pack, loader.resources.anim_texture.texture); creature_rend.UpdateData(); //creature_rend.pack_renderer.setActiveAnimation("default"); stage.addChild(testImg); stage.addChild(creature_rend); ticker.stop(); ticker.add((deltaTime) => { testImg.rotation += 0.01 * deltaTime; renderer.render(stage); }); ticker.start(); } I get an error when i add the chreature at stage line (stage.addChild(creature_rend)) The error derives from CreaturePixiPackJSRenderer.js at line74 "Uncaught TypeError: Cannot read property 'stop' of undefined" function CreaturePackRenderer(pack_data_in, texture_in) { console.log(texture_in); // <-- this texture exists ...... } CreaturePackRenderer.prototype._renderWebGL = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(!this.visible || this.alpha <= 0)return; // render triangles.. console.log(renderSession); // <-- exists console.log(renderSession.spriteBatch); // <-- undefined renderSession.spriteBatch.stop(); // <-- error ..... } I searched a bit and found out that this might be a texture issue. So i added the testImg at my main code with the same texture and if i remove the line that generates the error(stage.addChild(creature_rend)) then i can see the image. So the texture is not responsible. Both var creature_pack = new CreaturePackLoader(loader.resources.anim_data.data); var creature_rend = new CreaturePackRenderer(creature_pack, loader.resources.anim_texture.texture); return data. Is there any way to test the data if they are created correctly? I mean that even if i send invalid data as texture in CreaturePackRenderer, there is no error generated to point out that the data are wrong. Any directions what am i doing wrong or any directions to look for? Any help would be appreciated. p-cr.zip
  3. Thanks @kestrelm, I did notice them but wasn't sure about it. I will try to fix it on monday and post the results.
  4. I am still RnD and Creature is the first tryed because the artist all ready uses it. Spine is next to test.
  5. If i am not mistaken, Pixi.js is responsible for rendering in 2d context. I have tried here http://www.dsarmis.gr/games/cr/PixiJs-cp.html?useCanvas=1 useCanvas=1 uses canvas while useCanvas=0 uses webgl (if i am not mistaken since i am new on html5 and canvas) (Thanks for the response)
  6. Hello everyone. I am new to both pixi and creature. I am trying just to add a character with animation but i need it as optimized as it can be and to play on canvas. That is why i am trying to use the creaturePack instead of the json, and to use the js runtime instead of webassembly. I have been able to load the data but not render them. I am missing something about CreaturePixiJSRenderer.js. Any help would be appreciated I am posting the code and i will upload it in a repo in about an hour. Edit Could not share the repo so if anyone wants to take a look, the code is here http://www.dsarmis.gr/games/pixi-cr/p-cr.zip (PS. A server is needed in order to run) Edit var loader = PIXI.loader; var texture = null; var creature_pack = null; var creature_rend; var stage = new PIXI.Container(); var renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.view); renderer.backgroundColor = 0xffffaa; loader.add({name:"anim_data", url:"p3_setup_character_data.creature_pack", xhrType:"arraybuffer"}); texture = PIXI.Texture.fromImage("p3_setup_character_img.png"); loader.load((loader,resources)=>{ console.log(resources.anim_data); // Data exists creature_pack = new CreaturePackLoader(resources.anim_data.data); console.log(creature_pack); // Data exists creature_rend = new CreaturePackRenderer(creature_pack, texture); console.log(creature_rend); // Data exists creature_rend.pack_renderer.setActiveAnimation("default"); creature_rend.scale.set(100.0); creature_rend.timeDelta = 1; creature_rend.pack_renderer.syncRenderData(); stage.addChild(creature_rend); }); renderer.render(stage); p-cr.zip