Skip to content
Damnae edited this page Apr 13, 2016 · 9 revisions

Information about beatmaps can be retrieved by scripts through the Beatmap property.

The beatmap used by scripts has its name displayed in the timeline, you can switch to another beatmap by right clicking the timeline.

HitObjects

You can retrieve information common to all types of objects through the Beatmap's HitObjects property.

foreach (var hitobject in Beatmap.HitObjects)
{
    var sprite = layer.CreateSprite("sb/pl.png");
    sprite.Fade(hitobject.StartTime, hitobject.EndTime + 200, 1, 0);
    sprite.Move(hitobject.StartTime, hitobject.EndTime, hitobject.Position, hitobject.EndPosition);
}

Hitobjects can be an OsuCircle, OsuSlider, OsuSpinner or OsuHold. Here's an example of how to retrieve information that only certain type of objects have, like a slider's length:

var slider = hitobject as OsuSlider;
if (slider != null)
{
    var sliderLength = slider.Length;
    // etc.
}

Timing and Control Points

All timing points (red lines only) can be retrieved through the Beatmap's TimingPoints property. You can also use GetTimingPointAt(time) to retrieve the timing point used at a certain time.

The ControlPoints property and the GetControlPointAt(time) are the same, but return both red and green lines.

Other Properties

The Bookmarks property will list the times of all bookmarks.

A list of all beatmap properties available can be found while you type Beatmap. in your script.

Clone this wiki locally