mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09:00
Scale the playfield to avoid off-screen objects
This commit is contained in:
parent
a209415942
commit
362a5a39d0
@ -4,11 +4,14 @@
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
|
using osu.Game.Rulesets.Osu.UI;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Mods
|
namespace osu.Game.Rulesets.Osu.Mods
|
||||||
{
|
{
|
||||||
public class OsuModBarrelRoll : Mod, IUpdatableByPlayfield
|
public class OsuModBarrelRoll : Mod, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
|
||||||
{
|
{
|
||||||
[SettingSource("Roll speed", "Speed at which things rotate")]
|
[SettingSource("Roll speed", "Speed at which things rotate")]
|
||||||
public BindableNumber<double> SpinSpeed { get; } = new BindableDouble(1)
|
public BindableNumber<double> SpinSpeed { get; } = new BindableDouble(1)
|
||||||
@ -26,5 +29,11 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
playfield.Rotation = (float)(playfield.Time.Current / 1000 * SpinSpeed.Value);
|
playfield.Rotation = (float)(playfield.Time.Current / 1000 * SpinSpeed.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> drawableRuleset)
|
||||||
|
{
|
||||||
|
// scale the playfield to allow all hitobjects to stay within the visible region.
|
||||||
|
drawableRuleset.Playfield.Scale = new Vector2(OsuPlayfield.BASE_SIZE.Y / OsuPlayfield.BASE_SIZE.X);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user