scene

package module
Version: v0.0.0-...-e5ebb6e Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

This is a third-party package for ebiten(v2).

This package can only supports scene transition.

Example
if err := ebiten.RunGame(&Game{}); err != nil {
	log.Fatal(err)
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scene

type Scene interface {
	Update(sceneManager *SceneManager) error
	Draw(screen *ebiten.Image)
}

Scene is an interface with Draw and Update.

type SceneManager

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

SceneManager is a struct that holds the current scene and next scene Use it as a member variable of ebiten.Game interface.

func (*SceneManager) Draw

func (s *SceneManager) Draw(r *ebiten.Image)

Same as Draw() for ebiten.Game .

func (*SceneManager) GoTo

func (s *SceneManager) GoTo(scene Scene)

Change current in SceneManager to the scene of the argument.

func (*SceneManager) Update

func (s *SceneManager) Update() error

Same as Update() for ebiten.Game .

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to