PS_BEGIN_PATTERN(3)

✨ PS_BEGIN_PATTERN(3) ✨

okay bestie, welcome to the Library Functions Manual πŸ’– this is the one about starting a brand new pattern, let's get into it πŸŽ€


🌸 NAME 🌸

PS_begin_pattern β€” starts a new pattern ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <pslib.h>

int PS_begin_pattern(PSDoc *psdoc, float width, float height, float
xstep, float ystep, int painttype)

yes it's a chunky little signature, but she's worth it πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

okay so picture this: a pattern is basically like a color but for drawing and filling. iconic concept, no notes 🌈

And like β€” actually, PS_setcolor is the one you use to apply a pattern. That's the vibe. 🫢

The pattern itself has a given dimension and a stepping in the horizontal and vertical direction. The stepping only really kicks in when the area you're filling is bigger than the pattern itself. And when that happens? The pattern just gets repeated, with a distance of xstep going horizontal and ystep going vertical. tile tile tile, she's serving repetition πŸ’…

⚠️ and this is the part you do NOT skip: every single call of PS_begin_pattern must be accompanied by a call to PS_end_pattern(3). fr fr, do not leave her hanging, it's giving unfinished business and the library will not be happy 😭

πŸ‘‘ RETURN VALUE πŸ‘‘

she returns the identifier of the pattern, or zero if something went wrong πŸ’€

And just so we're clear: that identifier is a positive number greater than 0. so if you got a 0, that's not a pattern, that's a whole error, bestie πŸ™ˆ


🌈 SEE ALSO 🌈

  • PS_end_pattern(3) β€” her other half, the closing act πŸŽ€
  • PS_set_color(3) β€” how you actually put a pattern to work ✨

πŸŽ€ AUTHOR πŸŽ€

This manual page was written by Uwe Steinmann uwe@steinmann.cx. shoutout to Uwe, the original main character of this page πŸ’–


and that's the whole PS_BEGIN_PATTERN(3) situation, straight outta the Library Functions Manual, page three, no cap ✨ go forth, start your patterns, end your patterns, stay iconic πŸ¦‹πŸ’…πŸ‘‘

πŸ“¦ where this page comes from