Jump to content

lars

Members
  • Content Count

    61
  • Joined

  • Last visited

Everything posted by lars

  1. Hey I´m having some problems to stop multiple howl objects: I¨m doing as the following when i starting multiple sounds: this.soundEventOtherObj = new Howl({ src: [this.asset.get("sound/" + pathObj[ii].sound)], autoplay: true, loop: false }); this.collectSounds[ii]=this.soundEventOtherObj; console.log(this.collectSounds); this.collectSounds[ii].play(); Its a part of a loop. I collect the howl objects in a array to be
  2. Thank´s ... I will remember that 🙂
  3. It´s working now 🙂 let spritesheetPropsTexture = PIXI.Texture.from(this.asset.get("images/props.png")); let spritesheetPropsSprite = new PIXI.Sprite(spritesheetPropsTexture); this.mySheet = new PIXI.Spritesheet(spritesheetPropsSprite.texture.baseTexture, this.imagePropsJson); this.mySheet.parse((textures) => { let cheese = new PIXI.Sprite(this.mySheet.textures["antenne.png"]); cheese.x = 200; cheese.y = 200; this.scene.addChild(cheese); }) "this.asset.get" is just my own reference to files. The o
  4. Hi All I'm trying to setup a spritesheet like this: this.myLoader = new PIXI.Loader(); this.myLoader .add("images","assets/images/props.png") .add("json","assets/images/props.json") .load(startGame()); function startGame(){ let spritesheetPropsTexture = PIXI.Texture.from("assets/images/props.png"); let spritesheetPropsSprite = new PIXI.Sprite(spritesheetPropsTexture); let mySheet = new PIXI.Spritesheet(spritesheetPropsSprite.texture.baseTexture,"assets/images/props.json"); let cheese = new PIXI.Sprite(myspritesheet.textures[
  5. Hey im trying to find a way to load the png file directly, instead of using the fnt reference: <page id='0' file='myfont.png'/> Is there a way to do something like this: const bitmapFontText = new PIXI.BitmapText('some text', "myfont.png", { font: '20px myfont', align: 'left' }); or another workaround.
  6. Im trying to use a spine in a PIXI.Particlecontainer with no luck 🙂 const sprites = new PIXI.ParticleContainer(100, { scale: true, position: true, rotation: true, uvs: true, alpha: true, }); app.stage.addChild(sprites); const mImgSpine = new PIXI.spine.Spine(this.mpAssets.con); sprites.addChild(mImgSpine); // this fails Getting the error: Cannot read property 'baseTexture' of undefined Anyone knows if it's possible or its just a stupid idea 🙂 It works fine with a sprite: c
  7. Hello Im trying to find a way to use revolt.fx outside the pixi.loader and some of the loadBundleFile loader. The default way: const rfxBundleSettings = 'assets/default-bundle.json'; const rfxSpritesheet = 'assets/revoltfx-spritesheet.json'; const additionalAssets = ['assets/rfx-examples.json']; //Load bundle files and the additional example spritesheet fx.loadBundleFiles(rfxBundleSettings, rfxSpritesheet, null, additionalAssets).then(function (data) { app.ticker.add(function () { //Update the RevoltFX instance fx.update();
  8. Hey Spine.js need an update: spine version 3.8.60 has change part of the json structure. I have notice changes in "skins" and "animations" elements.
  9. Hey I trying to using Spine in my panda2 project, but get an error: spine.js:4426 Uncaught Error: Slot not found: name at SkeletonJson.readSkeletonData (spine.js:4426) at Class.staticInit (spine.js:6686) at Class.staticInit (core.js:1123) at new Class (core.js:1157) at Class.init (main.js:105) at new Class (core.js:1165) at Class.init (main.js:38) at new Class (core.js:1165) at Class._setSceneNow (system.js:397) at Class._run (system.js:355) I am using spine version: 3.8.60 Import as this: .require( 'game.assets', 'plugin.spine' ) And
  10. Im using spine version 3.7.94 an pixi-spine is from: https://github.com/pixijs/pixi-spine Im using it with ES6 and Node.js
  11. Hey Im trying to catch a spine timeline event in pixi: this.myMille.state.setAnimation(0, "BB-react-benzin-smallCar", false); this.myMille.state.onEvent = function(i, event) { console.log(event); if (event.name == "pickup"){ console.log('pickup'); } }; But it´s does not seems to work. Any ideas?
  12. Ok solved it, or my college did 🙂 this.collectNinjas.forEach(ninja =>{ if (this.ht.checkme(this.spr_hitArea, ninja )) { this.scene.removeChild(ninja); } } Thank you very much for the help Ivan. Super nice to have guys like you around 🙂
  13. Heres a working app. Its still in the Actors.js i doing my intersection. Thank you very much for having a look at it.
  14. Sorry. Theres only one comparison. So maybe thats the problem. But how do I compare with multiple object. I tried something like looping through my comparison this.setNinja = setInterval(() => { this.spr_ninjaCon = new PIXI.Container(); this.scene.addChild(this.spr_ninjaCon); this.ninja_hitArea = new PIXI.Graphics(); this.ninja_hitArea.beginFill("0x000000"); this.ninja_hitArea.alpha= 0.5; this.ninja_hitArea.drawRect(-20, -20, 40, 40); this.spr_ninjaCon
  15. Ok. Heres it is. And thank you very much for your time. Hope the code make sense 🙂 I have attached 2 files: The Hittest class and the Actor class. Where it all happens. Hopefully you will be able to read it in a minute 🙂 Hittest.js Actors.js
  16. Hello Everybody Trying to make a collision detection between two object. I have one object there is going to catch another object. Theres a new obejct to catcht every 10 seconds, and every thing goes fine when i catchs one object at time. But when theres multiple object on stage, something going wrong: Heres what im doing: Creating a "collector": this.spr_Con = new PIXI.Container(); this.scene.addChild(this.spr_Con); //Then creating the hitarea this.spr_hitArea = new PIXI.Graphics(); this.spr_hitArea.beginFill("0xffffff"); this
  17. Right now, when i want to "disable multitouch" I do the following: this.mouseCounter = 0: On a pointerDown event: this.mouseCounter++; if(this.mouseCounter < 2 ){ doSomeThing } On a pointerUp event: this.mouseCounter = 0; Simply q 🙂 Is there a better way to do this.
  18. Hi Ivan My drag and is not included in my example, it´s work ok, only, some attemp to add a object from one container to another container, and atemp to get it back to the original container 🙂
  19. Hello All I trying to make a object be dragged into a container and then be a child of this container like this: //places in a pointerup event let bl = otc.skeleton.findBone("left-hand-bone"); let point = oc.toGlobal({ 'x': bl.x, 'y': bl.y }); this.position.set(point.x - (oc.width - 5), point.y - (oc.height - 30)); // oCon.toLocal(this.position, this.parent, this.newPosition);//this i did not manage to get to work oc.addChild(this);//the container where drop the object(this) th
  20. Thank´s a lot Enpu. Was actually looking in the Spine doc. But did´nt find it ... sorry :-)
  21. Hello Anyone knows how to check if a Spine animation is complete. Tried: player.onComplete();
  22. lars

    Spine and events

    That did it. thank´s a lot :-)
  23. lars

    Spine and events

    Yes im using Pixi plugin and my spine works fine, but is not interactive. Where do I disable webGL. Tried to set it to false in the config.
  24. lars

    Spine and events

    Ok. I tried that to, and I cannot visual see the debug draw in the Panda2 editor when activate #. If I work outside Panda2 editor (Brackets) would i still be possible for me to debug the hit area in a browser like: ?debugDraw=true Heres what i tried (I startet with a class, but for now, to test is down to basic :-) : var container = new game.Container(); container.position.set(300, 800); container.interactive = true; container.hitArea = new game.Rectangle(237.15, 218.37); container.hitArea.x = -200; container.hitArea.y = 218; container.addTo(this.stage); var player = new gam
×
×
  • Create New...