private void prepareDrawables() { var type = Result?.Type ?? HitResult.Perfect; //TODO: better default type from ruleset if (type == currentDrawableType) { return; } InternalChild = JudgementBody = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Child = bodyDrawable = new SkinnableDrawable(new GameplaySkinComponent <HitResult>(type), _ => JudgementText = new OsuSpriteText { Text = type.GetDescription().ToUpperInvariant(), Font = OsuFont.Numeric.With(size: 20), Colour = colours.ForHitResult(type), Scale = new Vector2(0.85f, 1), }, confineMode: ConfineMode.NoScaling) }; currentDrawableType = type; }
public Column(int index) { Index = index; RelativeSizeAxes = Axes.Y; Width = COLUMN_WIDTH; Drawable background = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground()) { RelativeSizeAxes = Axes.Both }; InternalChildren = new[] { // For input purposes, the background is added at the highest depth, but is then proxied back below all other elements background.CreateProxy(), hitObjectArea = new ColumnHitObjectArea(HitObjectContainer) { RelativeSizeAxes = Axes.Both }, new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.KeyArea), _ => new DefaultKeyArea()) { RelativeSizeAxes = Axes.Both }, background, TopLevelContainer = new Container { RelativeSizeAxes = Axes.Both } }; TopLevelContainer.Add(hitObjectArea.Explosions.CreateProxy()); }
private void prepareDrawables() { var type = Result?.Type ?? HitResult.Perfect; //TODO: better default type from ruleset // todo: this should be removed once judgements are always pooled. if (type == currentDrawableType) { return; } // sub-classes might have added their own children that would be removed here if .InternalChild was used. if (JudgementBody != null) { RemoveInternal(JudgementBody); } aboveHitObjectsContent.Clear(); AddInternal(JudgementBody = new SkinnableDrawable(new GameplaySkinComponent <HitResult>(type), _ => CreateDefaultJudgement(type), confineMode: ConfineMode.NoScaling) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }); if (JudgementBody.Drawable is IAnimatableJudgement animatable) { var proxiedContent = animatable.GetAboveHitObjectsProxiedContent(); if (proxiedContent != null) { aboveHitObjectsContent.Add(proxiedContent); } } currentDrawableType = type; }
private void load() { Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2); Origin = Anchor.Centre; InternalChild = scaleContainer = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderScorePoint), _ => new CircularContainer { Masking = true, Origin = Anchor.Centre, Size = new Vector2(default_tick_size), BorderThickness = default_tick_size / 4, BorderColour = Color4.White, Child = new Box { RelativeSizeAxes = Axes.Both, Colour = AccentColour.Value, Alpha = 0.3f, } }) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }; ScaleBindable.BindValueChanged(scale => scaleContainer.Scale = new Vector2(scale.NewValue), true); }
private void load() { InternalChild = skinnableExplosion = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitExplosion), _ => new DefaultHitExplosion()) { RelativeSizeAxes = Axes.Both }; }
private void load() { Child = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.InputDrum), _ => new Container { RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new TaikoHalfDrum(false) { Name = "Left Half", Anchor = Anchor.Centre, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.X, X = -middle_split / 2, RimAction = TaikoAction.LeftRim, CentreAction = TaikoAction.LeftCentre }, new TaikoHalfDrum(true) { Name = "Right Half", Anchor = Anchor.Centre, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.X, X = middle_split / 2, RimAction = TaikoAction.RightRim, CentreAction = TaikoAction.RightCentre } } }); AddRangeInternal(sampleMapping.Sounds); }
public RingPiece() { Size = new Vector2(128); Anchor = Anchor.Centre; Origin = Anchor.Centre; InternalChild = new SkinnableDrawable("Play/osu/hitcircleoverlay", _ => new Container { Masking = true, CornerRadius = Size.X / 2, BorderThickness = 10, BorderColour = Color4.White, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new Box { AlwaysPresent = true, Alpha = 0, RelativeSizeAxes = Axes.Both } } }); }
public FollowPoint() { Origin = Anchor.Centre; Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.FollowPoint), _ => new Container { Masking = true, AutoSizeAxes = Axes.Both, CornerRadius = width / 2, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow, Colour = Color4.White.Opacity(0.2f), Radius = 4, }, Child = new Box { Size = new Vector2(width), Blending = BlendingParameters.Additive, Origin = Anchor.Centre, Anchor = Anchor.Centre, Alpha = 0.5f, } }, confineMode: ConfineMode.NoScaling); }
public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick) { Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2); Origin = Anchor.Centre; InternalChild = scaleContainer = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderScorePoint), _ => new CircularContainer { Masking = true, Origin = Anchor.Centre, Size = new Vector2(default_tick_size), BorderThickness = default_tick_size / 4, BorderColour = Color4.White, Child = new Box { RelativeSizeAxes = Axes.Both, Colour = AccentColour.Value, Alpha = 0.3f, } }) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }; }
public FollowPoint() { Origin = Anchor.Centre; Child = new SkinnableDrawable("Play/osu/followpoint", _ => new Container { Masking = true, AutoSizeAxes = Axes.Both, CornerRadius = width / 2, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow, Colour = Color4.White.Opacity(0.2f), Radius = 4, }, Child = new Box { Size = new Vector2(width), Blending = BlendingMode.Additive, Origin = Anchor.Centre, Anchor = Anchor.Centre, Alpha = 0.5f, } }, restrictSize: false); }
private void prepareDrawables() { var type = Result?.Type ?? HitResult.Perfect; //TODO: better default type from ruleset if (type == currentDrawableType) { return; } // sub-classes might have added their own children that would be removed here if .InternalChild was used. if (JudgementBody != null) { RemoveInternal(JudgementBody); } AddInternal(JudgementBody = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, Child = bodyDrawable = new SkinnableDrawable(new GameplaySkinComponent <HitResult>(type), _ => JudgementText = new OsuSpriteText { Text = type.GetDescription().ToUpperInvariant(), Font = OsuFont.Numeric.With(size: 20), Colour = colours.ForHitResult(type), Scale = new Vector2(0.85f, 1), }, confineMode: ConfineMode.NoScaling) }); currentDrawableType = type; }
private void load() { new BarLineGenerator <BarLine>(Beatmap).BarLines.ForEach(bar => Playfield.Add(bar)); FrameStableComponents.Add(scroller = new SkinnableDrawable(new TaikoSkinComponent(TaikoSkinComponents.Scroller), _ => Empty()) { RelativeSizeAxes = Axes.X, Depth = float.MaxValue }); }
private void load(TextureStore textures) { Child = new SkinnableDrawable("Play/osu/ring-glow", name => new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get(name), Blending = BlendingMode.Additive, Alpha = 0.5f }, false); }
public CirclePiece() { Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2); Masking = true; CornerRadius = Size.X / 2; Anchor = Anchor.Centre; Origin = Anchor.Centre; InternalChild = new SkinnableDrawable("Play/osu/hitcircle", _ => new DefaultCirclePiece()); }
private void load(TextureStore textures) { Child = new SkinnableDrawable("Play/osu/ring-glow", name => new Sprite { Anchor = Anchor.Centre, Origin = Anchor.Centre, Texture = textures.Get(name), Blending = BlendingParameters.Additive, Alpha = 0.5f }, s => s.GetTexture("Play/osu/hitcircle") == null); }
private void load(OsuColour colours) { Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { Text = Judgement.Result.GetDescription().ToUpper(), Font = @"Venera", Colour = Judgement.Result == HitResult.Miss ? colours.Red : Color4.White, Scale = new Vector2(0.85f, 1), TextSize = 12 }, restrictSize: false); }
private void load() { Anchor = Anchor.Centre; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; Size = Vector2.Zero; Alpha = 0f; AddInternal(Circle = new SkinnableDrawable(new TauSkinComponent(TauSkinComponents.HardBeat), _ => new HardBeatPiece(), ConfineMode.ScaleToFit)); Position = Vector2.Zero; }
public HitExplosion() { RelativeSizeAxes = Axes.Both; Anchor = Anchor.BottomCentre; Origin = Anchor.BottomCentre; InternalChild = skinnableExplosion = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.HitExplosion), _ => new DefaultHitExplosion()) { CentreComponent = false, Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre }; }
private void load(OsuColour colours) { this.colours = colours; Child = new SkinnableDrawable($"Play/{Result.Type}", _ => JudgementText = new OsuSpriteText { Text = Result.Type.GetDescription().ToUpperInvariant(), Font = @"Venera", Colour = judgementColour(Result.Type), Scale = new Vector2(0.85f, 1), TextSize = 12 }, restrictSize: false); }
private void load() { InternalChild = new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Child = cursorSprite = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.Cursor), _ => new DefaultCursor(), confineMode: ConfineMode.NoScaling) { Origin = Anchor.Centre, Anchor = Anchor.Centre, } }; }
private void prepareDrawables() { var type = Result?.Type ?? HitResult.Perfect; //TODO: better default type from ruleset // todo: this should be removed once judgements are always pooled. if (type == currentDrawableType) { return; } // sub-classes might have added their own children that would be removed here if .InternalChild was used. if (JudgementBody != null) { RemoveInternal(JudgementBody); } AddInternal(JudgementBody = new SkinnableDrawable(new GameplaySkinComponent <HitResult>(type), _ => CreateDefaultJudgement(type), confineMode: ConfineMode.NoScaling) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }); JudgementBody.OnSkinChanged += () => { // on a skin change, the child component will update but not get correctly triggered to play its animation (or proxy the newly created content). // we need to trigger a reinitialisation to make things right. proxyContent(); runAnimation(); }; proxyContent(); currentDrawableType = type; void proxyContent() { aboveHitObjectsContent.Clear(); if (JudgementBody.Drawable is IAnimatableJudgement animatable) { var proxiedContent = animatable.GetAboveHitObjectsProxiedContent(); if (proxiedContent != null) { aboveHitObjectsContent.Add(proxiedContent); } } } }
public Column(int index) { Index = index; RelativeSizeAxes = Axes.Y; Width = COLUMN_WIDTH; Drawable background = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground()) { RelativeSizeAxes = Axes.Both }; InternalChildren = new[] { hitExplosionPool = new DrawablePool <PoolableHitExplosion>(5), // For input purposes, the background is added at the highest depth, but is then proxied back below all other elements background.CreateProxy(), HitObjectArea = new ColumnHitObjectArea(Index, HitObjectContainer) { RelativeSizeAxes = Axes.Both }, new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.KeyArea), _ => new DefaultKeyArea()) { RelativeSizeAxes = Axes.Both }, background, hitSounds = new Container <SkinnableSound> { Name = "Column samples pool", RelativeSizeAxes = Axes.Both, Children = Enumerable.Range(0, max_concurrent_hitsounds).Select(_ => new SkinnableSound()).ToArray() }, TopLevelContainer = new Container { RelativeSizeAxes = Axes.Both } }; hitPolicy = new OrderedHitPolicy(HitObjectContainer); TopLevelContainer.Add(HitObjectArea.Explosions.CreateProxy()); RegisterPool <Note, DrawableNote>(10, 50); RegisterPool <HoldNote, DrawableHoldNote>(10, 50); RegisterPool <HeadNote, DrawableHoldNoteHead>(10, 50); RegisterPool <TailNote, DrawableHoldNoteTail>(10, 50); RegisterPool <HoldNoteTick, DrawableHoldNoteTick>(50, 250); }
public ExplodePiece() { Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2); Anchor = Anchor.Centre; Origin = Anchor.Centre; Blending = BlendingParameters.Additive; Alpha = 0; Child = new SkinnableDrawable("Play/osu/hitcircle-explode", _ => new TrianglesPiece { Blending = BlendingParameters.Additive, RelativeSizeAxes = Axes.Both, Alpha = 0.2f, }, s => s.GetTexture("Play/osu/hitcircle") == null); }
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result) { if (!result.IsHit || !judgedObject.DisplayResult || !DisplayJudgements.Value) { return; } var explosion = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitExplosion, Index), _ => new DefaultHitExplosion(judgedObject.AccentColour.Value, judgedObject is DrawableHoldNoteTick)) { RelativeSizeAxes = Axes.Both }; hitObjectArea.Explosions.Add(explosion); explosion.Delay(200).Expire(true); }
public ExplodePiece() { Size = new Vector2(128); Anchor = Anchor.Centre; Origin = Anchor.Centre; Blending = BlendingMode.Additive; Alpha = 0; Child = new SkinnableDrawable("Play/osu/hitcircle-explode", _ => new TrianglesPiece { Blending = BlendingMode.Additive, RelativeSizeAxes = Axes.Both, Alpha = 0.2f, }, false); }
public Column(int index) { Index = index; RelativeSizeAxes = Axes.Y; Width = COLUMN_WIDTH; Drawable background = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground()) { RelativeSizeAxes = Axes.Both }; InternalChildren = new[] { hitExplosionPool = new DrawablePool <PoolableHitExplosion>(5), sampleTriggerSource = new GameplaySampleTriggerSource(HitObjectContainer), // For input purposes, the background is added at the highest depth, but is then proxied back below all other elements background.CreateProxy(), HitObjectArea = new ColumnHitObjectArea(HitObjectContainer) { RelativeSizeAxes = Axes.Both }, new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.KeyArea), _ => new DefaultKeyArea()) { RelativeSizeAxes = Axes.Both }, background, TopLevelContainer = new Container { RelativeSizeAxes = Axes.Both }, new ColumnTouchInputArea(this) }; hitPolicy = new OrderedHitPolicy(HitObjectContainer); TopLevelContainer.Add(HitObjectArea.Explosions.CreateProxy()); RegisterPool <Note, DrawableNote>(10, 50); RegisterPool <HoldNote, DrawableHoldNote>(10, 50); RegisterPool <HeadNote, DrawableHoldNoteHead>(10, 50); RegisterPool <TailNote, DrawableHoldNoteTail>(10, 50); RegisterPool <HoldNoteTick, DrawableHoldNoteTick>(50, 250); }
public FlashPiece() { Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2); Anchor = Anchor.Centre; Origin = Anchor.Centre; Blending = BlendingMode.Additive; Alpha = 0; Child = new SkinnableDrawable("Play/osu/hitcircle-flash", name => new CircularContainer { Masking = true, RelativeSizeAxes = Axes.Both, Child = new Box { RelativeSizeAxes = Axes.Both } }, s => s.GetTexture("Play/osu/hitcircle") == null); }
public FlashPiece() { Size = new Vector2(128); Anchor = Anchor.Centre; Origin = Anchor.Centre; Blending = BlendingMode.Additive; Alpha = 0; Child = new SkinnableDrawable("Play/osu/hitcircle-flash", name => new CircularContainer { Masking = true, RelativeSizeAxes = Axes.Both, Child = new Box { RelativeSizeAxes = Axes.Both } }, false); }
internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result) { // Add judgement if (!judgedObject.DisplayResult || !DisplayJudgements.Value) { return; } if (!(judgedObject is DrawableNote note)) { return; } judgements.Clear(); judgements.Add(new DrawableNoteJudgement(result, judgedObject) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Y = calculator.YPositionAt(note.HitObject.Tone + 2) }); // Add hit explosion if (!result.IsHit) { return; } var explosion = new SkinnableDrawable(new KaraokeSkinComponent(KaraokeSkinComponents.HitExplosion), _ => new DefaultHitExplosion(judgedObject.AccentColour.Value, judgedObject is DrawableNote)) { Y = calculator.YPositionAt(note.HitObject.Tone) }; // todo : shpuld be added into hitObjectArea.Explosions // see how mania ruleset do hitObjectArea.Add(explosion); explosion.Delay(200).Expire(true); }
public ReverseArrowPiece() { Divisor = 2; MinimumBeatLength = 200; Anchor = Anchor.Centre; Origin = Anchor.Centre; Size = new Vector2(OsuHitObject.OBJECT_RADIUS * 2); Child = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.ReverseArrow), _ => new SpriteIcon { RelativeSizeAxes = Axes.Both, Blending = BlendingParameters.Additive, Icon = FontAwesome.Solid.ChevronRight, Size = new Vector2(0.35f) }) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }; }