rendering

package
v0.0.0-...-298bdd4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RenderingSystemType = ecs.NewSystemType[*RenderingSystem]()
View Source
var VisibilityComponentType = ecs.NewComponentType[*VisibilityComponent]()

Functions

func RegisterRenderers

func RegisterRenderers(renderers map[ecs.ComponentType]Renderer) error

Types

type Renderer

type Renderer func(world *ecs.World, entity ecs.Entity) (RenderingTask, int, error)

Renderer is a function that creates the RenderingTask for an entity.

It returns the RenderingTask, the Z-order for the entity, and any error that occurred.

type RenderingSystem

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

func NewRenderingSystem

func NewRenderingSystem() *RenderingSystem

func (*RenderingSystem) Disable

func (rs *RenderingSystem) Disable()

func (*RenderingSystem) Enable

func (rs *RenderingSystem) Enable()

func (*RenderingSystem) GetRenderingQueue

func (rs *RenderingSystem) GetRenderingQueue(world *ecs.World, viewport geometry.Rectangle64) ([]types.Pair[int, RenderingTask], error)

func (*RenderingSystem) IsEnabled

func (rs *RenderingSystem) IsEnabled() bool

func (*RenderingSystem) Render

func (rs *RenderingSystem) Render(world *ecs.World, buffer *ebiten.Image) error

func (*RenderingSystem) Type

func (rs *RenderingSystem) Type() ecs.SystemType

type RenderingTask

type RenderingTask func(surface *ebiten.Image, view ebiten.GeoM)

RenderingTask is a function that performs the rendering for a specific component.

type VisibilityComponent

type VisibilityComponent struct {
	IsVisible   bool
	VisibleArea types.Optional[geometry.Rectangle64]
}

func NewVisibilityComponent

func NewVisibilityComponent() *VisibilityComponent

NewVisibilityComponent creates a new VisibilityComponent to control the visibility of an entity within the rendering system.

Entities with a render component but not a visibility component are always considered visible. The visible area is in local coordinates.

func (*VisibilityComponent) Type

Jump to

Keyboard shortcuts

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