Sonolus Wiki

DrawCurvedR

Draw a skin sprite with curved edge.

Arguments

ArgumentDescription
idSprite identifier
x1X1
y1Y1
x2X2
y2Y2
x3X3
y3Y3
x4X4
y4Y4
zZ
aAlpha
nNumber of segments
pP of control point on right edge
qQ of control point on right edge

Return

0.

Remarks

Points are in the order of bottom-left, top-left, top-right, bottom-right.

Control point is calculated by bilinear interpolation using p and q, where bottom-left point is at (-1, -1) and top-right point is at (1, 1).

A Bézier curve is drawn on the curved edge with respective vertexes and control point.

Curved edges are drawn in segments. The bigger the number of segments, the smoother the curve, and the costlier the drawing.