Sign in to follow this  
Kokos

Phaser rope issues

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/

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.