[behavior] rex_spline

Post your work in progress addons and get feedback

Post » Wed Jun 29, 2016 3:54 am

See this demo first ( Capx ),
- click text "start" to stat moving
- drag the green way point to change the path


Document, plugin and sample capx file are included.


Compare with @Pode 's SplinePath behavior
- my spline behavior can assign a constant speed. Pode's can not assign speed and the moving speed is not constant.
- my spline behavior supports official save/load
Last edited by rexrainbow on Fri Nov 11, 2016 7:01 am, edited 1 time in total.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Wed Jun 29, 2016 3:58 am

@Jeff Skyrunner
@Mirlas

Here is my new spline behavior.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Wed Jun 29, 2016 5:15 am

Thank you for this!
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Wed Jun 29, 2016 6:28 am

Looks like there's a bug for when its not looping:
https://www.dropbox.com/s/uzg3ns9f8jtd3 ... .capx?dl=0

And its not looping when it's set to yes.
Image ImageImage
B
169
S
50
G
173
Posts: 8,317
Reputation: 110,278

Post » Wed Jun 29, 2016 8:16 am

Update
Fix the behavior of Looping.


@newt
Thanks for reply. I had fixed it.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Wed Jun 29, 2016 8:22 am

Thanks a bunch.
Really been wanting something like this.
Image ImageImage
B
169
S
50
G
173
Posts: 8,317
Reputation: 110,278

Post » Wed Jun 29, 2016 7:01 pm

Great!, watching the documentation I observed that "tension" is included, perfect.
B
29
S
12
G
21
Posts: 801
Reputation: 14,453

Post » Wed Jun 29, 2016 8:34 pm

Its not a real big deal, but as a suggestion it could use some point indexing like the path finding behavior does.
xy at point index, and current index, etc
It's not like we can't create our own lists.
Image ImageImage
B
169
S
50
G
173
Posts: 8,317
Reputation: 110,278

Post » Thu Jun 30, 2016 2:16 am

Update

Add
- "Expression:Point" to get all points in JSON, or a point in JSON, or X/Y co-ordinate of a point.
- "Expression:PointsCount" to get amount of points
- "Expression:CurSegP0", "Expression:CurSegP1" to get the point index of current segment ( moves from Expression:CurSegP0 to Expression:CurSegP1 )

See the document and sample capx.


@newt
Good suggestion! I had added them.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Thu Jun 30, 2016 3:54 am

I'm not seeing how this works:
Expression:Point

Get points or a point or x/y of a point. Add 1st parameter for index of point, add 2nd parameter "x" or "y" or 0 or 1 to get x/y of a point.

The expression just shows:
Sprite.Spline.Point
Image ImageImage
B
169
S
50
G
173
Posts: 8,317
Reputation: 110,278

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 1 guest