unpack

package
v0.0.3-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Unpacker

type Unpacker struct {
	// contains filtered or unexported fields
}

func NewUnpacker

func NewUnpacker(src image.Image, xTiles, yTiles, padding int) *Unpacker

func (*Unpacker) From6to16Terrain1

func (u *Unpacker) From6to16Terrain1() (*image.NRGBA, error)

From6to16Terrain1 generates a 16x1 tileset image from a 2x3 tileset using terrain 1 pattern. It uses the exported 6x6 to 28 tileset and appends specific tiles to create the terrain 1 pattern.

Parameters:

none

Returns:

*image.NRGBA - a pointer to the generated image
error - an error if the pack type is invalid

func (*Unpacker) From6to16Terrain2

func (u *Unpacker) From6to16Terrain2() (*image.NRGBA, error)

From6to16Terrain2 generates a 16x1 image from a 2x3 tileset using terrain 2 pattern. It uses the exported 6x6 tileset and appends specific tiles to create the terrain 2 pattern.

Parameters:

none

Returns:

*image.NRGBA - a pointer to the generated image
error - an error if the pack type is invalid

func (*Unpacker) From6to28

func (u *Unpacker) From6to28() (*image.NRGBA, error)

From6to28 generates a 14x2 canvas with 28 tiles from a 2x3 tileset. It uses the quadMap generated by the export6to28TileSet function to draw each tile.

Parameters:

none

Returns:

*image.NRGBA - a pointer to the generated image
error - an error if the pack type is invalid

func (*Unpacker) From6to48Terrain1

func (u *Unpacker) From6to48Terrain1() (*image.NRGBA, error)

From6to48Terrain1 generates a 12x4 tile set image from a 2x3 tile set using terrain 1 pattern. It uses the provided quadMap to determine the tile pattern for each tile.

Parameters:

none

Returns:

*image.NRGBA - a pointer to the generated image
error - an error if the pack type is invalid

func (*Unpacker) From6to48Terrain2

func (u *Unpacker) From6to48Terrain2() (*image.NRGBA, error)

From6to48Terrain2 generates a 12x4 tile set image from a 2x3 tile set using terrain 2 pattern. It draws the 48 tiles on the canvas using the quadMap to determine the tile pattern for each tile.

Parameters:

None

Returns:

*image.NRGBA - a pointer to the generated image
error - an error if the pack type is invalid

func (*Unpacker) Init

func (u *Unpacker) Init(tileSideSegments int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL