sonolus.script.bucket¶
Bucket
¶
Judgment
¶
Bases: IntEnum
The judgment of a hit.
JudgmentWindow
¶
Bases: Record
The window for judging the accuracy of a hit.
Usage
JudgmentWindow(perfect: Interval, great: Interval, good: Interval)
end: float
property
¶
The end time of the good interval.
good: Interval
instance-attribute
¶
Interval for a good hit.
great: Interval
instance-attribute
¶
Interval for a great hit.
perfect: Interval
instance-attribute
¶
Interval for a perfect hit.
start: float
property
¶
The start time of the good interval.
__add__(other: float | int) -> JudgmentWindow
¶
Add a scalar to the intervals.
__mul__(other: float | int) -> JudgmentWindow
¶
Multiply the intervals by a scalar.
judge(actual: float, target: float) -> Judgment
¶
update(perfect: Interval | None = None, great: Interval | None = None, good: Interval | None = None)
¶
bucket(*, sprites: list[_BucketSprite], unit: str | None = None) -> Any
¶
Define a bucket with the given sprites and unit.
bucket_sprite(*, sprite: Sprite, fallback_sprite: Sprite | None = None, x: float, y: float, w: float, h: float, rotation: float = 0) -> _BucketSprite
¶
Define a sprite for a bucket.
buckets(cls: type[T]) -> T | Buckets
¶
Decorator to define a buckets class.
Usage
@buckets
class Buckets:
note: Bucket = bucket(
sprites=[
bucket_sprite(
sprite=Skin.note,
x=0,
y=0,
w=2,
h=2,
)
],
unit=StandardText.MILLISECOND_UNIT,
)