PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
g17khqpukees4237dtn3astzapmp462vjhsz6st4 / settlers / nft
Files
7 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft/v0
gno
0.9

Files (7)

  • README.mdmarkdown
  • gnomod.tomltoml
  • data.gnogno
  • doc.gnogno
  • grid.gnogno
  • svg.gnogno
  • traits.gnogno
README.mdPreviewRaw
# Settlers NTF

Package that draws the Settlers, small pixel-art gnomes, as an SVG.

Given the same traits, it always draws the same image, so it's safe and cheap for any
realm to import and call directly.

Code also lives in [jeronimoalbi/gnoland-settlers](https://github.com/jeronimoalbi/gnoland-settlers).

## From a seed

```go
traits := nft.NewTraits("some-seed-string")
svg := nft.RenderSVG(traits, nft.Options{Size: 512})
```

The traits (skin, hat, beard, clothes, glasses, background, and so on) are all worked
out deterministically from the seed, so the same seed always gives the same gnome.

## From packed traits

Traits are usually stored packed into a single `uint32`:

```go
packed := nft.Pack(traits)
traits, err := nft.FromPacked(packed)
svg := nft.RenderSVG(traits, nft.Options{})
```

`Options` also takes `NoBackground` (a transparent image) and `BackgroundColor`
(a custom one). `RenderDataURI` gives the same image as a `data:image/svg+xml;...` URI,
ready to use as an `<img>` source.

## License

The art itself is dedicated to the public domain under CC0 1.0 Universal; see `Credits`.

Functions

not supported for pure packages by the node (vm/qfuncs)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.