lars

Members
  • Content count

    43
  • Joined

  • Last visited

About lars

Contact Methods

  • Twitter
    @lgre63

Recent Profile Visitors

1,078 profile views
  1. lars

    Drag into container and out again

    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 🙂
  2. 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) this.position.set(point.x - (oc.width - 30), point.y - (oc.height + 30)); And work fairly 🙂 But then when i want to drag the object out of the container again i gives me som problems: //placed in a pointerdown event if (globals.objectUsed) { // if the object is dragged to the new container in first place oCon.addChild(this); // send it back to its original container this.position.set(e.data.getLocalPosition(oCon).x, e.data.getLocalPosition(oCon).y); globals.objectUsed = false; isIntersected = false; } It´s kind of work. But the idea is that when the object is placed the first time and I want to drag it back to the original container its should happend when I startDrag(pointerdown), but i have to wait for the pointerup otherwise I still drag the object in its parent container (whichs is having a drag method. Could anyone guide be in the right direction it would be so nice ... hopefully me explaining its not to much rubbish 🙂 Regards Lars
  3. lars

    Check if a Spine animation is complete

    Thank´s a lot Enpu. Was actually looking in the Spine doc. But did´nt find it ... sorry :-)
  4. Hello Anyone knows how to check if a Spine animation is complete. Tried: player.onComplete();
  5. lars

    Spine and events

    That did it. thank´s a lot :-)
  6. 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.
  7. 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 game.Spine('kristian-ronnie.json'); //player.hitArea = new game.Rectangle(200, 500); //player.position.set(300, 800); player.play('idle', true); player.addTo(container); container.click = function() { console.log('check clicked'); }; }
  8. lars

    Spine and events

    Hello Im trying to make my spine object interactive: var player = new game.Spine('mySpine.json'); //player.hitArea = new game.Rectangle(200, 500); player.position.set(300, 800); player.interactive = true; player.play('idle', true); //player.speed = 0.01 player.addTo(this.stage); player.click = function() { console.log('check clicked'); }; That did not work. I tried to put it in a container. That did not help either. It works OK an a sprite object.
  9. lars

    Spine and mesh

    Works perfectly :-) Thanks
  10. lars

    Spine and mesh

    So cool.
  11. lars

    Spine and mesh

    Super fantastic ... I really like what you have done with Panda...
  12. lars

    Spine and mesh

    Hello First of all. I m so glad to see Panda on the road again :-) I have just bought the full version and playing around with Spritesheets developed in Spine 3.6.52 professional. It seems like mesh is not supported in panda 2 version 1.5.0. When I export from spine as a spritesheet with mesh animations it won´t show the spritesheet, If i remove the Mesh animation it shows the animation fine: game.module( 'game.main' ) .require( 'plugin.spine' ) .body(function() { //game.addAsset('panda.png'); game.addAsset('sheep.atlas'); game.addAsset('sheep.json'); game.createScene('Main', { init: function() { var player = new game.Player(); player.sprite.addTo(this.stage); } }); game.createClass('Player', { init: function() { //this.sprite = new game.Sprite('panda.png'); this.sprite = new game.Spine('sheep.json'); this.sprite.position.x = 200; this.sprite.position.y = 800; this.sprite.play('idle', true); } }); });
  13. lars

    Loader in Pandajs 2

    Ehh .... ok. No support of MP3 :-)
  14. lars

    Loader in Pandajs 2

    Only one thing: If I try to preload mp3 like: game.addMedia('sound/soundwaterdrop.*', 'water'); Errror: Uncaught Unsupported file format * or game.addMedia('sound/soundwaterdrop.mp3', 'water'); Error: Unsupported file format mp3 This happens in the updated 2.0 version: https://github.com/ekelokorpi/panda-engine/tree/develop/src Have been trying to look around in the Loader.js file ... but ... :-)
  15. lars

    Loader in Pandajs 2

    Hello Enpu So f...... nice to have you back :-) . It´s working now. Thanks a lot ... Heres how I did (just a dummy, with some stolen parts), and put a reference in the config.js file as you said :-) : game.config = { system: { width: 1024, height: 768, center: true, scale: true, loader: 'MyLoader' } }; And the dummy loader: game.module( 'game.main' ) .require( 'game.assets' ) .body(function() { this.bar; game.createClass('MyLoader', 'Loader', { onStart: function() { this.bar = new game.Graphics(); this.bar.beginFill('#ccc'); this.bar.drawRect(0, 0, 260, 40); this.bar.x = game.system.width / 2 - (260 / 2); this.bar.y = game.system.height / 2 - (40 / 2); this.bar.scale.x = this.percent / 100; this.bar.addTo(this.stage); }, onProgress: function() { console.log(this.percent); //console.log(this.sprite.x); this.bar.scale.x = this.percent / 100; }, onComplete: function() { game.system.setScene('Main'); } }); game.createScene('Main', { backgroundColor: '#666', init: function() { console.log('opo'); } }); });