structure

package
v0.0.0-...-d4fbba4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

type Layer interface {
	// Draw is called every frame to render the game to screen.
	Draw(screen *ebiten.Image)
}

Layer represents a visually distinct layer of the UI that can be rendered independently of the rest.

type Layers

type Layers []Layer

Layers is a collection of Layers, which can be rendered in order.

func (Layers) Draw

func (l Layers) Draw(screen *ebiten.Image)

Draw invokes the Draw method of each Layer in the collection in order.

type Scene

type Scene interface {
	// Update is called every frame to update the state of the game.
	Update() (Scene, error)

	// Draw is called every frame to render the game to screen.
	Draw(screen *ebiten.Image)
}

Scene describes a single "scene" or screen in the game, such as a particular menu or level.

type SceneGame

type SceneGame struct {
	Scene Scene
}

SceneGame is an Ebiten Game implementation that defers all drawing and updating logic to a "Scene".

The Scene's Update() method returns the next Scene to be rendered, allowing the game to transition between different views based on the current state.

func (*SceneGame) Draw

func (s *SceneGame) Draw(screen *ebiten.Image)

func (*SceneGame) Layout

func (s *SceneGame) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)

func (*SceneGame) Update

func (s *SceneGame) Update() (err error)

Jump to

Keyboard shortcuts

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