This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- bezier curve drawing functions for playdate lua | |
| -- these are based on de Casteljau's algorithm | |
| -- this site has a nice interactive demo to compare both types of curve: https://pomax.github.io/bezierinfo/#flattening | |
| -- draws a curve starting at x1,y1, ending at x3,y3, with x2,y2 being a control point that "pulls" the curve towards it | |
| -- steps is the number of line segments to use, lower is better for performance, higher makes your curve look smoother | |
| -- the playdate is kinda slow, so it's recommended to find a relatively low step number that looks passable enough! | |
| function drawQuadraticBezier(x1, y1, x2, y2, x3, y3, steps) | |
| steps = steps or 8 | |
| local d = 1 / steps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" | |
| "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <!-- (ORIGINAL AUTHOR, ORIGINAL HEADER) | |
| BBEdit Applescript Codeless Language Module. | |
| Bill Hernandez <http://www.mac-specialist.com/> | |
| Version 1.0.1 | |
| Updated - Monday, November 20, 2006 ( 6:41 PM ) | |
| Updated - Tuesday, November 21, 2006 ( 10:05 PM ) |