osu

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeStandard = iota
	ModeTaiko
	ModeCatch
	ModeMania
)
View Source
const (
	HitTypeNote    = 1 << iota
	HitTypeSlider  // 1 << 1 = 2
	NewCombo       // Appears as 5 = 1 + 4 at first note.
	HitTypeSpinner // 1 << 3 = 8

	ComboColourSkip1
	ComboColourSkip2
	ComboColourSkip3
	HitTypeHoldNote // 1 << 7 = 128
)
View Source
const (
	HitSoundNormal = 1 << iota
	HitSoundWhistle
	HitSoundFinish
	HitSoundClap
)
View Source
const ModeOsu = ModeStandard

Variables

This section is empty.

Functions

This section is empty.

Types

type Colours

type Colours struct {
	Combos              [8]color.RGBA
	SliderTrackOverride color.RGBA
	SliderBorder        color.RGBA
}

type Difficulty

type Difficulty struct {
	HPDrainRate       float64
	CircleSize        float64
	OverallDifficulty float64
	ApproachRate      float64
	SliderMultiplier  float64
	SliderTickRate    float64
}

type Editor

type Editor struct {
	Bookmarks       []int // delimiter,
	DistanceSpacing float64
	BeatDivisor     int
	GridSize        int
	TimelineZoom    float64
}

type Event

type Event struct {
	Type      string
	StartTime int
	EndTime   int
	Filename  string
	XOffset   int
	YOffset   int
}

Storyboard is not fully implemented so far.

type Format

type Format struct {
	FormatVersion int // delimiter:(space)
	General
	Editor
	Metadata
	Difficulty
	Events       []Event
	TimingPoints []TimingPoint
	Colours      // Beware this is not a slice.
	HitObjects   []HitObject
}

Format is preferred name to Type because Type is a more general term.

func NewFormat added in v0.6.0

func NewFormat(r io.Reader) (f *Format, err error)

func (Format) Background added in v0.6.0

func (f Format) Background() (Event, bool)

func (Format) Video added in v0.6.0

func (f Format) Video() (Event, bool)

type General

type General struct {
	AudioFilename            string
	AudioLeadIn              int
	AudioHash                string // deprecated
	PreviewTime              int
	Countdown                int
	SampleSet                string
	StackLeniency            float64
	Mode                     int
	LetterboxInBreaks        bool
	StoryFireInFront         bool // deprecated
	UseSkinSprites           bool
	AlwaysShowPlayfield      bool // deprecated
	OverlayPosition          string
	SkinPreference           string
	EpilepsyWarning          bool
	CountdownOffset          int
	SpecialStyle             bool
	WidescreenStoryboard     bool
	SamplesMatchPlaybackRate bool
}

type HitObject

type HitObject struct {
	X            int
	Y            int
	Time         int
	NoteType     int
	HitSound     int
	EndTime      int
	SliderParams SliderParams
	HitSample    HitSample
}

func (HitObject) Column

func (ho HitObject) Column(columnCount int) int

Column returns index of column at osu!mania playfield.

func (HitObject) IsBig added in v0.6.0

func (ho HitObject) IsBig() bool

func (HitObject) IsDon added in v0.6.0

func (ho HitObject) IsDon() bool

func (HitObject) IsKat added in v0.6.0

func (ho HitObject) IsKat() bool

func (HitObject) SampleFilename added in v0.6.0

func (h HitObject) SampleFilename() string

func (HitObject) SliderDuration

func (h HitObject) SliderDuration(speed float64) int

SliderDuration returns duration of slider in milliseconds.

func (HitObject) SliderLength

func (h HitObject) SliderLength() float64

If hit object is not slider, both count and unit will be zero.

type HitSample

type HitSample struct {
	NormalSet   int    // Sample set of the normal sound.
	AdditionSet int    // Sample set of the whistle, finish, and clap sounds.
	Index       int    // If this is 0, the timing point's sample index will be used.
	Volume      int    // If this is 0, the timing point's volume will be used.
	Filename    string // Custom filename of the addition sound.
}

type Metadata

type Metadata struct {
	Title         string
	TitleUnicode  string
	Artist        string
	ArtistUnicode string
	Creator       string
	Version       string
	Source        string
	Tags          []string // delimiter(space)
	BeatmapID     int
	BeatmapSetID  int
}

type Point added in v0.6.0

type Point = [2]int // delimiter:

type SliderParams

type SliderParams struct {
	CurveType   string  // one letter
	CurvePoints []Point // delimiter|
	Slides      int
	Length      float64
	EdgeSounds  []int   // delimiter|
	EdgeSets    []Point // delimiter|
}

type TimingPoint

type TimingPoint struct {
	Time        int
	BeatLength  float64
	Meter       int
	SampleSet   int
	SampleIndex int
	Volume      int
	Uninherited bool
	Effects     int
}

func (TimingPoint) BPM

func (tp TimingPoint) BPM() float64

BPM supposes the given timing point is Uninherited.

func (TimingPoint) BeatLengthScale

func (tp TimingPoint) BeatLengthScale() float64

BeatLengthScale returns a beat scale, aka speed factor. The standard value is 1. BeatLengthScale supposes the given timing point is Inherited.

func (TimingPoint) IsFirstBarOmitted

func (tp TimingPoint) IsFirstBarOmitted() bool

func (TimingPoint) IsInherited

func (tp TimingPoint) IsInherited() bool

Inherited means some of its values are derived from the base timing point. The base timing point is called Uninherited. Todo: parent timing point or previous timing point?

func (TimingPoint) IsKiai

func (tp TimingPoint) IsKiai() bool

Kiai infers to highlight.

Jump to

Keyboard shortcuts

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