Fusion icon indicating copy to clipboard operation
Fusion copied to clipboard

Add support for Bezier curves.

Open howmanysmall opened this issue 4 years ago • 3 comments

These are super flexible (probably more so than springs) which is why they should be added.

howmanysmall avatar Sep 28 '21 16:09 howmanysmall

I assume you're talking about cubic Bezier curves, similar to how they might be implemented in CSS?

I think it'd be good to include some hypothetical usage, so here's how I think an API like this could work:

local position = UDim2.fromScale(0.25, 0.25)

local smoothPosition = Bezier(position, Vector2.new(0.17, 0), Vector2.new(0.02, 0.97)) 
-- 2 control points for cubic Bezier easing curve - starts at (0, 0) and ends at (1, 1)
-- could be replaced by state objects containing Vector2s!
-- X coordinates are clamped between 0 and 1 to ensure one Y solution for every X between 0 and 1

dphfox avatar Sep 28 '21 16:09 dphfox

That's exactly what I'd want. I'd do it how it was done in BoatTween (although there is an error on it) instead of Vector2s though.

howmanysmall avatar Sep 28 '21 16:09 howmanysmall

Blocked by #87

dphfox avatar Feb 26 '22 23:02 dphfox

Merging with #87

dphfox avatar Feb 01 '23 01:02 dphfox