scene

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CursorBase = iota
	CursorAdditive
	CursorTrail
)

Variables

View Source
var Faces = make(map[int]font.Face)

Functions

func Face added in v0.6.0

func Face(size int) font.Face

func IsEnterJustPressed added in v0.6.0

func IsEnterJustPressed() bool

func IsEscapeJustPressed added in v0.6.0

func IsEscapeJustPressed() bool

func NewBackgroundBrightnessKeyHandler added in v0.6.0

func NewBackgroundBrightnessKeyHandler(cfg *Config, asset *Asset) func() bool

func NewBackgroundDrawer added in v0.6.0

func NewBackgroundDrawer(cfg *Config, asset *Asset, fsys fs.FS, name string) func(draws.Image)

asset.go: functions that load assets from fs.FS. draw.go: functions that draw.

func NewDebugPrintKeyHandler added in v0.6.0

func NewDebugPrintKeyHandler(cfg *Config, asset *Asset) func() bool

func NewModeKeyHandler added in v0.6.0

func NewModeKeyHandler(cfg *Config, asset *Asset) func() bool

func NewMusicOffsetKeyHandler added in v0.6.0

func NewMusicOffsetKeyHandler(cfg *Config, asset *Asset) func() bool

func NewMusicVolumeKeyHandler added in v0.6.0

func NewMusicVolumeKeyHandler(cfg *Config, asset *Asset) func() bool

func NewSoundVolumeKeyHandler added in v0.6.0

func NewSoundVolumeKeyHandler(cfg *Config, asset *Asset) func() bool

func NewSpeedScaleKeyHandler added in v0.6.0

func NewSpeedScaleKeyHandler(cfg *Config, asset *Asset, _mode int) func() bool

func NewSubModeKeyHandler added in v0.6.0

func NewSubModeKeyHandler(cfg *Config, asset *Asset) func() bool

func SetTPS added in v0.6.0

func SetTPS(tps float64)

Types

type Asset added in v0.6.0

type Asset struct {
	CursorSprites           [3]draws.Sprite
	DefaultBackgroundSprite draws.Sprite
	BoxMaskSprite           draws.Sprite
	ClearSprite             draws.Sprite
	IntroSprite             draws.Sprite
	LoadingSprite           draws.Sprite
	SearchBoxSprite         draws.Sprite

	EnterSound       audios.SoundPlayer
	SwipeSoundPod    audios.SoundPlayer
	TapSoundPod      audios.SoundPlayer
	ToggleSounds     [2]audios.SoundPlayer
	TransitionSounds [2]audios.SoundPlayer

	// Each key count has different asset in piano mode.
	PianoAssets map[int]*piano.Asset
}

Asset is previously known as Skin.

func NewAsset added in v0.6.0

func NewAsset(cfg *Config, fsys fs.FS) *Asset

type Config added in v0.6.0

type Config struct {
	MusicRoots []string
	ScreenSize draws.Vector2

	MusicVolume          float64
	SoundVolume          float64
	MusicOffset          int32
	BackgroundBrightness float64
	DebugPrint           bool
	Replay               bool

	CursorSpriteScale   float64
	ChartTreeNodeWidth  float64
	ChartTreeNodeHeight float64
	ChartTreeNodeShrink float64 // Nodes are not focused will be shrinked.
	SearchBoxWidth      float64
	SearchBoxHeight     float64
	ClearSpriteScale    float64

	Mode        int
	SubMode     int
	PianoConfig *piano.Config
}

scene.Config and scene.Asset contains all the configuration and assets that are used in the game. They are passed to other scenes. There should not be any additional configuration or assets in other scenes.

func NewConfig added in v0.6.0

func NewConfig() *Config

func (Config) ChartTreeNodeCount added in v0.6.0

func (cfg Config) ChartTreeNodeCount() int

func (Config) DebugString added in v0.6.0

func (cfg Config) DebugString() string

func (*Config) NormalizeMusicRoots added in v0.6.0

func (c *Config) NormalizeMusicRoots()

type PlayArgs added in v0.6.0

type PlayArgs struct {
	MusicFS       fs.FS
	ChartFilename string
	Replay        *osr.Format
}

type Scene

type Scene interface {
	Update() any
	Draw(screen draws.Image)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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