Tirex::Backend(3pm)

๐Ÿ’– Tirex::Backend ๐Ÿ’–

okay bestie, listen โ€” this is the Perl module Tirex::Backend, aka the Generic Tirex rendering backend, straight out of the User Contributed Perl Documentation. she's a parent class, she's iconic, and she's about to make your backend dreams come true โœจ


๐ŸŒธ NAME ๐ŸŒธ

Tirex::Backend โ€” Generic Tirex rendering backend ๐Ÿ’…

no cap, that's literally her whole deal: she's the blueprint, the mother of all Perl rendering backends ๐Ÿซถ


โœจ SYNOPSIS โœจ

here's the vibe, copy-paste girlies:

use Tirex::Backend::Test;
my $backend = Tirex::Backend::Test->new();
$backend->main();

that's it. that's the whole ritual ๐Ÿ”ฎ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so, this is a parent class for rendering backends written in Perl. she does not render anything herself โ€” she's giving main character energy as the foundation, and you build on top of her ๐Ÿ˜Œ

to actually use her, you make a subclass (like Tirex::Backend::Test, for example โ€” she's the queen of examples ๐Ÿ’œ). subclass = your own custom backend that inherits all the structure. slay.


๐ŸŽ€ METHODS ๐ŸŽ€

๐ŸŒˆ Tirex::Backend->new($name)

bestie, do not instantiate this class directly. like, seriously, don't ๐Ÿ‘€ she's abstract-ish in spirit. instead, create instances of a subclass. that's the whole point. periodt.

๐ŸŒŸ $backend->check_map_config($map)

this one checks a map config for this backend โ€” syntactic validity, other validity, the whole vibe check ๐ŸŒธ

if it fails? she should croak ๐Ÿ˜ญ (that's Perl-speak for "die loudly", not a frog situation, iykyk).

fr fr โ€” you're supposed to overwrite this in the subclass. don't leave it as-is and expect magic.

๐Ÿ’ซ $backend->set_status('text')

sets the status text, which shows up in the ps output. so when someone runs ps and sees your process, they see your little status message ๐Ÿ‘‘

๐Ÿ”ฅ $backend->main()

the core backend method, the moment we've all been waiting for ๐ŸŽฌ

call this directly after creating a subclass with new(). she will:

  1. parse the config file(s) ๐Ÿ“„
  2. set everything up ๐Ÿ› ๏ธ
  3. wait for rendering requests ๐Ÿ‘€
  4. fulfill them by calling create_metatile() ๐ŸŽจ

she's the whole engine. the GOAT.

๐Ÿงš $backend->create_metatile($map, $metatile)

creates a metatile. that's it, that's the description ๐Ÿฆ‹

โš ๏ธ this method has to be overwritten in subclasses โ€” non-negotiable, bestie. if you don't, nothing happens. like, at all. ๐Ÿ’€

๐Ÿ“ $backend->write_metatile($image, $filename, $metatile)

takes a single image the size of a metatile, cuts it into tiles โœ‚๏ธ, then re-assembles those tiles back into a metatile ๐ŸŒˆ and writes it to disk ๐Ÿ’พ

it's giving craft project. it's giving puzzle. it's giving slay.

๐Ÿ‘‘ $backend->create_error_image($map, $metatile)

creates an error image in case a renderer didn't work ๐Ÿ˜ญ

and what does that error image look like? a black/yellow checkerboard pattern ๐Ÿ–ค๐Ÿ’› โ€” iconic, honestly, very hazard-tape chic.

this method can be overwritten in subclasses (optional, unlike the others โ€” you have free will here ๐Ÿ’…)

and that's the whole page bestie!! you ate that ๐Ÿ’–โœจ

signed off with love from perl v5.40.1, dated 2026-08-09 โ€” mwah, go build something gorgeous ๐ŸŽ€๐Ÿฆ‹๐Ÿ’œ

๐Ÿ“ฆ where this page comes from