render

package
v0.0.0-...-557e180 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawAll

func DrawAll(grid *geometry.ScreenGrid, screen *ebiten.Image, s *world.Surface, view geometry.Rectangle)

func Register

func Register[I Image, F Font]()

func Systems

func Systems[I Image, F Font]() loki.System

Types

type AirDashAnimation

type AirDashAnimation[I Image] struct {
	loki.Attribute[AirDashAnimation[I]]
	Animation[I]
}

func (*AirDashAnimation[I]) GetFrame

func (a *AirDashAnimation[I]) GetFrame() I

func (AirDashAnimation[I]) Unwrap

func (a AirDashAnimation[I]) Unwrap() AirDashAnimation[I]

type Animation

type Animation[I Image] struct {
	Slot     int
	Time     fixed.Fixed
	PerFrame fixed.Fixed
	Frames   []I
}

func (*Animation[I]) GetFrame

func (a *Animation[I]) GetFrame() I

func (Animation[I]) GetSlot

func (a Animation[I]) GetSlot() int

func (*Animation[I]) Increment

func (a *Animation[I]) Increment(span fixed.Fixed)

func (*Animation[I]) Max

func (a *Animation[I]) Max() fixed.Fixed

type ColoredCircle

type ColoredCircle struct {
	loki.Attribute[visuals.Renderable]
	Slot   int
	Layer  visuals.Layer
	Radius fixed.Fixed
	Color  color.Color
	Offset geometry.Vector
}

func (ColoredCircle) Draw

func (r ColoredCircle) Draw(grid *geometry.ScreenGrid, pos geometry.Vector, screen *ebiten.Image)

func (ColoredCircle) GetLayer

func (r ColoredCircle) GetLayer() visuals.Layer

func (ColoredCircle) GetSlot

func (r ColoredCircle) GetSlot() int

type ColoredRect

type ColoredRect struct {
	loki.Attribute[visuals.Renderable]
	Slot   int
	Layer  visuals.Layer
	Bounds geometry.Rectangle
	Color  color.Color
	Offset geometry.Vector
}

func (ColoredRect) Draw

func (r ColoredRect) Draw(grid *geometry.ScreenGrid, pos geometry.Vector, screen *ebiten.Image)

func (ColoredRect) GetLayer

func (r ColoredRect) GetLayer() visuals.Layer

func (ColoredRect) GetSlot

func (r ColoredRect) GetSlot() int

type Drawable

type Drawable interface {
	Draw(*geometry.ScreenGrid, geometry.Vector, *ebiten.Image)
}

type EdgeGrabAnimation

type EdgeGrabAnimation[I Image] struct {
	loki.Attribute[EdgeGrabAnimation[I]]
	Animation[I]
}

func (*EdgeGrabAnimation[I]) GetFrame

func (a *EdgeGrabAnimation[I]) GetFrame() I

func (EdgeGrabAnimation[I]) Unwrap

func (a EdgeGrabAnimation[I]) Unwrap() EdgeGrabAnimation[I]

type FallAnimation

type FallAnimation[I Image] struct {
	loki.Attribute[FallAnimation[I]]
	Animation[I]
}

func (FallAnimation[I]) Unwrap

func (a FallAnimation[I]) Unwrap() FallAnimation[I]

type Font

type Font interface {
	Get(float64) text.Face
}

type HoverSprite

type HoverSprite[I Image] struct {
	Sprite[I]
	Show bool
}

func (HoverSprite[I]) Draw

func (t HoverSprite[I]) Draw(grid *geometry.ScreenGrid, pos geometry.Vector, screen *ebiten.Image)

type HoverText

type HoverText[F Font] struct {
	Text[F]
	Show bool
}

func (HoverText[F]) Draw

func (t HoverText[F]) Draw(grid *geometry.ScreenGrid, pos geometry.Vector, screen *ebiten.Image)

type IdleAnimation

type IdleAnimation[I Image] struct {
	loki.Attribute[IdleAnimation[I]]
	Animation[I]
}

func (IdleAnimation[I]) Unwrap

func (a IdleAnimation[I]) Unwrap() IdleAnimation[I]

type Image

type Image interface {
	Get() *ebiten.Image
}

type JumpAnimation

type JumpAnimation[I Image] struct {
	loki.Attribute[JumpAnimation[I]]
	Animation[I]
}

func (JumpAnimation[I]) Unwrap

func (a JumpAnimation[I]) Unwrap() JumpAnimation[I]

type LandAnimation

type LandAnimation[I Image] struct {
	loki.Attribute[LandAnimation[I]]
	Animation[I]
}

func (LandAnimation[I]) Unwrap

func (a LandAnimation[I]) Unwrap() LandAnimation[I]

type NeighborMappedBlockRenderer

type NeighborMappedBlockRenderer[I Image] struct {
	loki.Behavior[visuals.StructureElementRenderer]
	Grid    geometry.BlockGrid
	Layer   visuals.Layer
	Scale   geometry.Vector
	TileSet NeighborTileSet[I]
}

func (NeighborMappedBlockRenderer[I]) Render

func (r NeighborMappedBlockRenderer[I]) Render(ctx loki.Context, blocks []world.StructureElement, queue visuals.RenderQueue)

type NeighborTileSet

type NeighborTileSet[I Image] interface {
	Get(visuals.NeighborMask) I
}

type SimpleBlockRenderer

type SimpleBlockRenderer[I Image] struct {
	loki.Behavior[visuals.StructureElementRenderer]
	Grid   geometry.BlockGrid
	Layer  visuals.Layer
	Scale  geometry.Vector
	Sprite I
}

func (SimpleBlockRenderer[I]) Render

func (r SimpleBlockRenderer[I]) Render(ctx loki.Context, blocks []world.StructureElement, queue visuals.RenderQueue)

type Sprite

type Sprite[I Image] struct {
	loki.Attribute[visuals.Renderable]
	Slot     int
	Image    I
	Layer    visuals.Layer
	Scale    geometry.Vector
	Rotation float64

	Offset geometry.Vector
}

func (Sprite[I]) Draw

func (s Sprite[I]) Draw(grid *geometry.ScreenGrid, pos geometry.Vector, screen *ebiten.Image)

func (Sprite[I]) GetLayer

func (s Sprite[I]) GetLayer() visuals.Layer

func (Sprite[I]) GetSlot

func (s Sprite[I]) GetSlot() int

type Text

type Text[F Font] struct {
	loki.Attribute[visuals.Renderable]
	Slot     int
	Layer    visuals.Layer
	Content  string
	Font     F
	Size     float64
	Color    color.RGBA
	Scale    geometry.Vector
	Rotation float64
	Centered bool

	Offset geometry.Vector
}

func (Text[F]) Draw

func (t Text[F]) Draw(grid *geometry.ScreenGrid, pos geometry.Vector, screen *ebiten.Image)

func (Text[F]) GetLayer

func (t Text[F]) GetLayer() visuals.Layer

func (Text[F]) GetSlot

func (t Text[F]) GetSlot() int

type WalkAnimation

type WalkAnimation[I Image] struct {
	loki.Attribute[WalkAnimation[I]]
	Animation[I]
}

func (WalkAnimation[I]) Unwrap

func (a WalkAnimation[I]) Unwrap() WalkAnimation[I]

type XIndexedBlockRenderer

type XIndexedBlockRenderer[I Image] struct {
	loki.Behavior[visuals.StructureElementRenderer]
	Grid    geometry.BlockGrid
	Layer   visuals.Layer
	Scale   geometry.Vector
	Sprites []I
}

func (XIndexedBlockRenderer[I]) Render

func (r XIndexedBlockRenderer[I]) Render(ctx loki.Context, blocks []world.StructureElement, queue visuals.RenderQueue)

Jump to

Keyboard shortcuts

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