Skip to content

G2D.Bezier

boxgaming edited this page Sep 25, 2023 · 2 revisions

Draws a bezier curve.

Syntax

G2D.Bezier sx&, sy&, cy1&, cy1&, cy2&, cy2&, ex&, ey&[, clr~&]

Parameters

  • The curve will be drawn between the specified starting position (sy&, sy&) and the ending position (ex&, ey&_).
  • The center positions (cx1&, cy1&) and (cx2&, cy2&) are used to define the direction and depth of the curve.
  • The optional color~& parameter defines the color of the triangle. If not specified, the default color will be used.

Examples

Example1: Draw a bezier curve between two specified locations on screen.

Import G2D From "lib/graphics/2d.bas"

Dim As Integer sx, sy, cx1, cy1, cx2, cy2, ex, ey
sx  = 100: sy  = 100
cx1 = 300: cy1 = 50
cx2 = 200: cy2 = 300
ex  = 400: ey  = 300

Circle (sx, sy), 5, 9
Circle (ex, ey), 5, 9
Circle (cx1, cy1), 5, 14
Circle (cx2, cy2), 5, 14
G2D.Bezier sx, sy, cx1, cy1, cx2, cy2, ex, ey, 2

See Also

G2D.Curve

Clone this wiki locally