Documentation
¶
Index ¶
- Variables
- func RegisterRenderers(renderers map[ecs.ComponentType]Renderer) error
- type Renderer
- type RenderingSystem
- func (rs *RenderingSystem) Disable()
- func (rs *RenderingSystem) Enable()
- func (rs *RenderingSystem) GetRenderingQueue(world *ecs.World, viewport geometry.Rectangle64) ([]types.Pair[int, RenderingTask], error)
- func (rs *RenderingSystem) IsEnabled() bool
- func (rs *RenderingSystem) Render(world *ecs.World, buffer *ebiten.Image) error
- func (rs *RenderingSystem) Type() ecs.SystemType
- type RenderingTask
- type VisibilityComponent
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 ¶
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) Type ¶
func (rs *RenderingSystem) Type() ecs.SystemType
type RenderingTask ¶
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 ¶
func (c *VisibilityComponent) Type() ecs.ComponentType
Click to show internal directories.
Click to hide internal directories.