-
Notifications
You must be signed in to change notification settings - Fork 35
Beatmap Data
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.
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.
}
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.
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.
Need help with something that isn't in the wiki? Try contacting Damnae in osu! or Discord.
