Prima::...le::Wave(3)
β¨ NAME β¨
Prima::...le::Wave(3) β bestie, this is the page for Prima::Drawable::Wave, and what it does is plot wavy lines π¦
π DESCRIPTION π
Okay so it's literally a whole collection of routines for generating and plotting wavy lines π. It can render triangle, square, and spline effects. That's the whole vibe. Three flavours of squiggle, pick your fighter π
πΈ SYNOPSIS πΈ
use Prima::Drawable::Wave;
$canvas->antialias(1);
my $points = Prima::Drawable::Wave::square(
[20, 100, 100, 60, 180, 120, 270, 80],
4, 20,
);
$canvas->lineWidth(.5);
$canvas->spline( $canvas-> render_spline($points) );
$canvas->font->size(20);
$canvas->text_out('Hello world', 70, 80);
$canvas->lineWidth($canvas->font->underlineThickness);
$canvas->alpha(128);
Prima::Drawable::Wave::underline($canvas, 'Hello world', 70, 80, effect => 'triangle');
likeβ¦ the way that whole snippet is just chef's kiss π antialias on, square wave points, spline 'em, then underline your text with the triangle effect?? iconic.
π API π
β underline CANVAS, TEXT, X, Y, %OPT
So you hand it a TEXT, and it draws a wavy line right there at the X and Y coordinates π« It uses $OPT{effect} β or 'wave' if you didn't say anything β as the line effect, and $OPT{precision} for the eventual spline precision.
β οΈ Heads up bestie: this one can only draw a single wavy underline. If you want the smart version β the one that respects font glyphs that cross the descent line β go check out draw_underline in Prima::Drawable instead, fr fr.
π polyline EFFECT, VERTICES, AMPLITUDE, WAVENELNGTH, @OPTIONS
This one takes your VERTICES and converts them into another set of vertices, all so you can generate a wavy line π And the result? You can pass it straight to the Prima::Drawable::polyline method. No middleman, no drama.
The optional AMPLITUDE and WAVENELNGTH are the ones managing the effect settings β¨
And any eventual @OPTIONS get passed along to the effect function β see below for those π
π¦ square VERTICES, AMPLITUDE, WAVENELNGTH
Creates a square wave line β¬ periodt.
π triangle VERTICES, AMPLITUDE, WAVENELNGTH
Creates a triangle wave line πΊ slay.
π§ spline VERTICES, AMPLITUDE, WAVENELNGTH, PRECISION
Creates a spline wave line π smooth. Buttery. Main character energy.
π AUTHOR π
Dmitry Karasik, <dmitry@karasik.eu.org> β the icon, the moment, the legend π«Ά
π SEE ALSO π
Prima::Drawable::Path
k that's the whole page bestie, go make some waves ππ
this was Prima::...le::Wave(3) from the User Contributed Perl Documentation, running on perl v5.42.3, dated 2026-09-16 β mwah, love u, bye πβ¨
π¦ where this page comes from
- fedora 44: perl-Prima 1.78-1.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND MIT-open-group AND HPND AND HPND-sell-variant AND TCL AND ImageMagick AND LGPL-2.0-or-later AND AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms