components

package
v1.32.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

type Components struct {
	Engine *EngineComponents
	Game   interface{}
}

Components contains engine and game components

func InitComponents

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

InitComponents initializes components

type EngineComponents

type EngineComponents struct {
	SpriteRender *ecs.SliceComponent
	Transform    *ecs.SliceComponent
	Text         *ecs.SliceComponent
	UITransform  *ecs.SliceComponent
}

EngineComponents contains references to all engine 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
}

Sprite structure

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
}

SpriteSheet structure

type Texture

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

Texture structure

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