Jump to content

Phaser rope issues


Kokos
 Share

Recommended Posts

I'm trying to use Phaser Ropes in order to populate the top of a curved world with ground. As the rope is a mesh that distorts an image its perfect for this purpose. However I'm running into two issues.

1. According to the docs, a Phaser Rope is "a Sprite that has a repeating texture.". This doesn't seem to be the case however, with a simple fiddle it already shows that the texture is stretched (and loses its aspect ratio in the process): https://jsfiddle.net/qruppmzu/

Is it possible to actually turn this into a repeating texture instead of causing it to stretch? Currently I need to use a whole lot of ropes to populate the world, which becomes heavy on performance really quickly. I can generate / move the ropes as you progress through the world but having one rope seems like a better idea (if it works).

2. Even though the constructor allows it, the rope doesn't work with texture atlasses. How would I go about getting this to work? My framework depends on everything being in an atlas, apart from rebuilding it makes little sense to have one single sprite outside of the atlas because of a bug like this. 

See: https://jsfiddle.net/qruppmzu/1/

Link to comment
Share on other sites

It looks like the docs for the Phaser Rope were written like a wish list, before the features were implemented, so it doesn't quite deliver the advertised functionality.  It doesn't use frames from atlases and can't animate frames, it's very much tied to a single base texture.  Look at the functionality of the base pixi.js rope/strip to see what the limitations are.

I had a look at this a while ago, it'll need quite a bit of work in both Phaser and Pixi to get it up to spec.  I nice little project for someone...

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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