components

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DungeonTileSize = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

type Components struct {
	Game interface{}
}

Components contains engine and game components

func InitComponents

func InitComponents(manager *ecs.Manager, gameComponents interface{}) *Components

InitComponents initializes components

type Sprite

type Sprite struct {
	// Horizontal position of the sprite in the sprite sheet
	X int
	// Vertical position of the sprite in the sprite sheet
	Y int
	// Width of the sprite
	Width int
	// Height of the sprite
	Height int
}

スプライトは1つ1つの意味をなす画像の位置を示す情報 1ファイルに対して複数のスプライトが定義されている

type SpriteRender

type SpriteRender struct {
	// Reference sprite sheet
	SpriteSheet *SpriteSheet
	// Index of the sprite on the sprite sheet
	SpriteNumber int
	// Draw options
	Options ebiten.DrawImageOptions
}

SpriteRender component

type SpriteSheet

type SpriteSheet struct {
	// Texture image
	Texture Texture `toml:"texture_image"`
	// List of sprites
	Sprites []Sprite
}

画像ファイルであるテクスチャと、その位置ごとの解釈であるスプライトのマッピング

type Texture

type Texture struct {
	// Texture image
	Image *ebiten.Image
}

複数のスプライトが格納された画像ファイル

func (*Texture) UnmarshalText

func (t *Texture) UnmarshalText(text []byte) error

UnmarshalText fills structure fields from text data

Jump to

Keyboard shortcuts

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