Prima::...le::Wave(3)

πŸ“¦ version 1.78, in fedora 44

✨ 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