util

package module
v0.0.0-...-dfc2b70 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tiles

type Tiles struct {
	Width   int             // tile width
	Height  int             // tile height
	Columns int             // number of tiles per row
	Rows    int             // number of rows
	List    []*ebiten.Image // list of tiles (0..Width*Height)
}

struct Tiles contains a list of image tiles. It also contains the tile dimension

func ReadTiles

func ReadTiles(r io.Reader, nx, ny int) (*Tiles, error)

ReadTiles read the tiles from a png file

func ReadTilesScaledTo

func ReadTilesScaledTo(r io.Reader, nx, ny int, tw, th int) (*Tiles, error)

func (*Tiles) At

func (t *Tiles) At(x, y int) *ebiten.Image

At return the tile at the coordinates x, y

func (*Tiles) Item

func (t *Tiles) Item(i int) *ebiten.Image

Item return the tile at (linear) position i

Jump to

Keyboard shortcuts

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