[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.
Goodbye
B
115
S
31
G
295
Posts: 4,549
Reputation: 164,633

Post » Wed Jun 29, 2016 3:58 am

@Jeff Skyrunner
@Mirlas

Here is my new spline behavior.
Goodbye
B
115
S
31
G
295
Posts: 4,549
Reputation: 164,633

Post » Wed Jun 29, 2016 5:15 am

Thank you for this!
Learning other engines, but C2 still rocks. Image Image Image Image
B
81
S
22
G
96
Posts: 2,467
Reputation: 58,351

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.
B
179
S
50
G
208
Posts: 8,721
Reputation: 128,810

Post » Wed Jun 29, 2016 8:16 am

Update
Fix the behavior of Looping.


@newt
Thanks for reply. I had fixed it.
Goodbye
B
115
S
31
G
295
Posts: 4,549
Reputation: 164,633

Post » Wed Jun 29, 2016 8:22 am

Thanks a bunch.
Really been wanting something like this.
B
179
S
50
G
208
Posts: 8,721
Reputation: 128,810

Post » Wed Jun 29, 2016 7:01 pm

Great!, watching the documentation I observed that "tension" is included, perfect.
B
36
S
15
G
22
Posts: 958
Reputation: 15,226

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.
B
179
S
50
G
208
Posts: 8,721
Reputation: 128,810

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.
Goodbye
B
115
S
31
G
295
Posts: 4,549
Reputation: 164,633

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
B
179
S
50
G
208
Posts: 8,721
Reputation: 128,810

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests