Jump to content

PIXI Strip/Rope in Phaser


wayfinder
 Share

Recommended Posts

One of the coolest new things in PIXI 1.6 are strips and ropes. I'm trying to use them in my Phaser project, but they don't have preUpdate or postUpdate methods and so Phaser throws an error. What's the way to go here? Extend sprite? I'm unsure how exactly. 

 

Any help is appreciated!

Link to comment
Share on other sites

I have to admit I'm completely lost with this. Here's what I have so far:

Phaser.RopeSprite = function (game, x, y, name, key, frame, points) {     Phaser.Sprite.call(this, game, x, y, name);     this.rope = new PIXI.Rope(PIXI.Texture.fromImage(key), points);    this.rope.parent = this;    this.refresh = PIXI.Rope.prototype.refresh.call(this.rope);    this.updateTransform = PIXI.Rope.prototype.updateTransform.call(this.rope);    this.setTexture = PIXI.Rope.prototype.setTexture.call(this.rope);    }; Phaser.RopeSprite.prototype = Object.create(Phaser.Sprite.prototype);Phaser.RopeSprite.prototype.constructor = Phaser.RopeSprite;

But the updateTransform of my RopeSprite is undefined :( What am I doing wrong?

 
 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...