Over the last month or so, I’ve been experimenting with Bézier type lines in LiveCode, using some code from several years ago by Jim Hurley, master of mathematics, and graphics pro Alejandro Tejada. I’ve reconfigured the code to work as behaviors, and arranged the controls into two object types: Bézier lines, and control points (which are groups). This way, all objects operate from a single code source, and can be cloned as needed. I also modified the way the control points work, creating “reverse-mirrored” control handles, to better simulate how control points work in vector drawing applications.
While the operation of the controls is pretty good, LiveCode’s whole-pixel card resolution for polygons limits how smoothly the curves can be drawn. For large drawings, this might be acceptable. As a workaround, I’ve been experimenting with drawing duplicate lines at double size in a separate window and bringing back a half-scale image snapshot back into the main stack to simulate antialiasing of sorts. It’s not an ideal solution, but for certain applications might be passable.
You can get the Bézier test stack by executing the following line in your message box:

(Visited 393 times, 1 visits today)