rendersystems

package
v0.0.3-early-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0, MIT Imports: 13 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAnimationFrame

func GetAnimationFrame(sheet coldbrew.Sprite, anim blueprintclient.AnimationData, frameIndex int, logger *slog.Logger) *ebiten.Image

GetAnimationFrame extracts a single frame from a sprite sheet based on animation data

func RenderBackground

func RenderBackground(
	backgroundSprite coldbrew.Sprite,
	position vector.Two,
	bgConfig *blueprintclient.ParallaxBackground,
	cam coldbrew.Camera,
	sceneWidth int,
)

RenderBackground draws a parallax background with proper scrolling behavior

func RenderEntity

func RenderEntity(
	position vector.Two,
	rotation float64,
	scale vector.Two,
	direction blueprintspatial.Direction,
	spr coldbrew.Sprite,
	blueprint *blueprintclient.SpriteBlueprint,
	cam coldbrew.Camera,
	currentTick int,
)

RenderEntity draws a single entity with all its transformations applied

func RenderEntityFromCursor

func RenderEntityFromCursor(cursor *warehouse.Cursor, cam coldbrew.Camera, currentTick int)

RenderEntityFromCursor renders an entity directly from a warehouse cursor

func RenderSprite

func RenderSprite(
	sprite coldbrew.Sprite,
	position vector.Two,
	rotation float64,
	scale vector.Two,
	offset vector.Two,
	direction blueprintspatial.Direction,
	static bool,
	cam coldbrew.Camera,
)

RenderSprite draws a static sprite with transformations applied

func RenderSpriteSheetAnimation

func RenderSpriteSheetAnimation(
	sheet coldbrew.Sprite,
	spriteBlueprint *blueprintclient.SpriteBlueprint,
	index int,
	position vector.Two,
	rotation float64,
	scale vector.Two,
	direction blueprintspatial.Direction,
	offset vector.Two,
	static bool,
	cam coldbrew.Camera,
	tick int,
	logger *slog.Logger,
)

RenderSpriteSheetAnimation draws an animated sprite with proper frame selection

func RenderTiles

func RenderTiles(
	sprite coldbrew.Sprite,
	blueprint *blueprintclient.SpriteBlueprint,
	entityPosition vector.Two,
	direction blueprintspatial.Direction,
	rotation blueprintspatial.Rotation,
	scale vector.Two,
	cam coldbrew.Camera,
)

RenderTiles draws tiles from a tileset

Types

type DebugRenderer

type DebugRenderer struct{}

DebugRenderer visualizes physics and collisions for debugging purposes It operates independently from actual collision processing systems A messy expensive system...a temporary solution for now

func (*DebugRenderer) Render

func (sys *DebugRenderer) Render(cli coldbrew.Client, screen coldbrew.Screen)

Render draws debug information when debug visualization is enabled Displays shapes and their collisions for each active camera

type GlobalRenderer

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

GlobalRenderer is the default render system for the coldbrew package It automatically handles sprites, sprite sheets, tiles, and parallax backgrounds

func (GlobalRenderer) Render

func (sys GlobalRenderer) Render(cli coldbrew.Client, screen coldbrew.Screen)

Render processes all renderable entities within a scene and presents them to screen

type RenderItem

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

RenderItem contains all state needed for rendering an entity

type ShapeInfo

type ShapeInfo struct {
	Shape    blueprintspatial.Shape
	Position vector.Two
}

ShapeInfo stores the shape and position data for rendering

Jump to

Keyboard shortcuts

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