tilemaps

package
v0.0.0-...-9fa0b82 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TilemapComponentType = ecs.NewComponentType[*TilemapComponent]()
View Source
var TilemapRenderComponentType = ecs.NewComponentType[*TilemapRenderComponent]()

Functions

func TilemapRenderer

func TilemapRenderer(world *ecs.World, entity ecs.Entity) (rendering.RenderingTask, int, error)

Types

type Tilemap

type Tilemap struct {
	Rows      int    `json:"rows"`
	Columns   int    `json:"columns"`
	TilesetID string `json:"tileset_id"`
	// contains filtered or unexported fields
}

func NewTilemap

func NewTilemap(rows, columns int, tilesetID string) *Tilemap

func (*Tilemap) ClearDirtyTiles

func (t *Tilemap) ClearDirtyTiles()

func (*Tilemap) Fill

func (t *Tilemap) Fill(tile int)

func (*Tilemap) GetTile

func (t *Tilemap) GetTile(x, y int) (tile int)

func (*Tilemap) IsDirty

func (t *Tilemap) IsDirty() bool

func (*Tilemap) MarshalJSON

func (t *Tilemap) MarshalJSON() ([]byte, error)

func (*Tilemap) SetTile

func (t *Tilemap) SetTile(x, y, tile int)

func (*Tilemap) Size

func (t *Tilemap) Size() int

func (*Tilemap) UnmarshalJSON

func (t *Tilemap) UnmarshalJSON(data []byte) error

type TilemapComponent

type TilemapComponent struct {
	TilemapID string
}

func NewEmptyTilemapComponent

func NewEmptyTilemapComponent() *TilemapComponent

func NewTilemapComponent

func NewTilemapComponent(tilemapID string) *TilemapComponent

func (*TilemapComponent) Type

type TilemapRenderComponent

type TilemapRenderComponent struct {
	ZOrder int
}

func NewTilemapRenderComponent

func NewTilemapRenderComponent(zOrder int) *TilemapRenderComponent

func (*TilemapRenderComponent) Type

type TilemapStorage

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

func Storage

func Storage() *TilemapStorage

func (*TilemapStorage) Allocate

func (c *TilemapStorage) Allocate(key string, data []byte) error

func (*TilemapStorage) AssetTypes

func (c *TilemapStorage) AssetTypes() types.HashSet[string]

func (*TilemapStorage) Deallocate

func (c *TilemapStorage) Deallocate(key string) error

func (*TilemapStorage) DefaultKey

func (c *TilemapStorage) DefaultKey() string

func (*TilemapStorage) Get

func (c *TilemapStorage) Get(key string) (*Tilemap, error)

func (*TilemapStorage) Has

func (c *TilemapStorage) Has(key string) bool

func (*TilemapStorage) Put

func (c *TilemapStorage) Put(key string, value any) error

func (*TilemapStorage) SetDefault

func (c *TilemapStorage) SetDefault(key string) error

Jump to

Keyboard shortcuts

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