golemutils

package
v0.0.0-...-5b716a5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 13 Imported by: 8

Documentation

Index

Constants

View Source
const (
	StickTopLeft = iota
	StickTopRight
	StickBottomLeft
	StickBottomRight
	RefreshNever = -1
	RefreshOnce  = -2
)

Variables

This section is empty.

Functions

func AssertImplementsDrawer

func AssertImplementsDrawer(name string, s any, t *testing.T)

func AssertImplementsDrawerOnce

func AssertImplementsDrawerOnce(name string, s any, t *testing.T)

func AssertImplementsUpdater

func AssertImplementsUpdater(name string, s any, t *testing.T)

func AssertImplementsUpdaterOnce

func AssertImplementsUpdaterOnce(name string, s any, t *testing.T)

Types

type Game

type Game struct {
	golem.World
}

func NewGame

func NewGame() *Game

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)

func (*Game) Update

func (g *Game) Update() error

type Metrics

type Metrics struct {
	*Panel
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(l golem.LayerID, rate time.Duration) *Metrics

func (*Metrics) DrawOnce

func (m *Metrics) DrawOnce(screen *ebiten.Image, w golem.World)

func (*Metrics) GetLayer

func (m *Metrics) GetLayer() golem.LayerID

type Panel

type Panel struct {
	Str        string
	Margin     float32
	Padding    float32
	Background color.RGBA
	Foreground color.RGBA
	Ticker     *time.Ticker
	Rate       time.Duration
	GetStr     func(w golem.World) string
	Stick      int
	Layer      golem.LayerID
	Font       font.Face
	// contains filtered or unexported fields
}

func NewPanel

func NewPanel(layer golem.LayerID, refresh func(w golem.World) string, rate time.Duration) *Panel

func (*Panel) DrawOnce

func (p *Panel) DrawOnce(screen *ebiten.Image, w golem.World)

func (*Panel) GetLayer

func (p *Panel) GetLayer() golem.LayerID

func (*Panel) Refresh

func (p *Panel) Refresh(w golem.World)

func (*Panel) UpdateOnce

func (p *Panel) UpdateOnce(w golem.World, _ golem.Clock)

Jump to

Keyboard shortcuts

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