예제 #1
0
        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;
        }
예제 #2
0
        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());
        }
예제 #3
0
        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;
        }
예제 #4
0
        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);
        }
예제 #5
0
 private void load()
 {
     InternalChild = skinnableExplosion = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitExplosion), _ => new DefaultHitExplosion())
     {
         RelativeSizeAxes = Axes.Both
     };
 }
예제 #6
0
파일: InputDrum.cs 프로젝트: matyjb/osu
        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);
        }
예제 #7
0
        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
                    }
                }
            });
        }
예제 #8
0
파일: FollowPoint.cs 프로젝트: pttb369/osu
        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);
        }
예제 #9
0
        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,
            };
        }
예제 #10
0
파일: FollowPoint.cs 프로젝트: vbe0201/osu
        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);
        }
예제 #11
0
        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;
        }
예제 #12
0
        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
            });
        }
예제 #13
0
 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);
 }
예제 #14
0
        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());
        }
예제 #15
0
파일: GlowPiece.cs 프로젝트: nikkuuwu/osu
 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);
 }
예제 #16
0
 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);
 }
예제 #17
0
        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;
        }
예제 #18
0
        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
            };
        }
예제 #19
0
        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);
        }
예제 #20
0
파일: OsuCursor.cs 프로젝트: zi-jing/osu
 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,
         }
     };
 }
예제 #21
0
        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);
                    }
                }
            }
        }
예제 #22
0
파일: Column.cs 프로젝트: zi-jing/osu
        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);
        }
예제 #23
0
        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);
        }
예제 #24
0
파일: Column.cs 프로젝트: hibi0228/osu
        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);
        }
예제 #25
0
        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);
        }
예제 #26
0
파일: Column.cs 프로젝트: omkelderman/osu
        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);
        }
예제 #27
0
파일: FlashPiece.cs 프로젝트: yansaan/osu
        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);
        }
예제 #28
0
        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);
        }
예제 #29
0
        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);
        }
예제 #30
0
        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,
            };
        }