Beispiel #1
0
        private void load()
        {
            Children = new Framework.Graphics.Drawable[]
            {
                //todo: share this more
                new BufferedContainer
                {
                    RelativeSizeAxes      = Axes.Both,
                    CacheDrawnFrameBuffer = true,
                    Children = new Framework.Graphics.Drawable[]
                    {
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor       = Anchor.TopCentre,
                            Origin       = Anchor.TopCentre,
                            AccentColour = AccentColour,
                            Scale        = new Vector2(0.6f),
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor       = Anchor.CentreLeft,
                            Origin       = Anchor.CentreLeft,
                            AccentColour = AccentColour,
                            Y            = -0.08f
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor       = Anchor.CentreRight,
                            Origin       = Anchor.CentreRight,
                            AccentColour = AccentColour,
                            Y            = -0.08f
                        },
                        new Pulp
                        {
                            RelativePositionAxes = Axes.Both,
                            Anchor       = Anchor.BottomCentre,
                            Origin       = Anchor.BottomCentre,
                            AccentColour = AccentColour,
                        },
                    }
                }
            };

            if (HitObject.HyperDash)
            {
                Add(new Pulp
                {
                    RelativePositionAxes = Axes.Both,
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    AccentColour = Color4.Red,
                    Blending     = BlendingMode.Additive,
                    Alpha        = 0.5f,
                    Scale        = new Vector2(2)
                });
            }
        }
Beispiel #2
0
        public BeatmapSetHeader(BeatmapSetInfo beatmapSet)
        {
            Children = new Framework.Graphics.Drawable[]
            {
                new Box
                {
                    Colour           = new Color4(85, 85, 85, 255),
                    RelativeSizeAxes = Axes.Both,
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Framework.Graphics.Drawable[]
                    {
                        new Box // TODO: Gradient
                        {
                            Colour           = new Color4(0, 0, 0, 100),
                            RelativeSizeAxes = Axes.Both,
                        }
                    }
                },
                new FlowContainer
                {
                    Direction = FlowDirection.VerticalOnly,
                    Spacing   = new Vector2(0, 2),
                    Padding   = new MarginPadding {
                        Top = 10, Left = 15, Right = 10, Bottom = 10
                    },
                    AutoSizeAxes = Axes.Both,
                    Children     = new[]
                    {
                        // TODO: Make these italic
                        new SpriteText
                        {
                            Text     = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode,
                            TextSize = 20
                        },
                        new SpriteText
                        {
                            Text     = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode,
                            TextSize = 16
                        },
                        new FlowContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Children     = new[]
                            {
                                new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)),
                                new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(246, 101, 166, 255)),
                            }
                        }
                    }
                }
            };

            Deselected();
        }
Beispiel #3
0
        public BeatmapPanel(BeatmapSetInfo set, BeatmapInfo beatmap)
        {
            Beatmap = beatmap;
            Height *= 0.75f;

            Children = new Framework.Graphics.Drawable[]
            {
                new Box
                {
                    Colour           = new Color4(40, 86, 102, 255), // TODO: gradient
                    RelativeSizeAxes = Axes.Both,
                    Size             = Vector2.One,
                },
                new FlowContainer
                {
                    Padding      = new MarginPadding(5),
                    Direction    = FlowDirection.HorizontalOnly,
                    AutoSizeAxes = Axes.Both,
                    Children     = new Framework.Graphics.Drawable[]
                    {
                        new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)),
                        new FlowContainer
                        {
                            Padding = new MarginPadding {
                                Left = 10
                            },
                            Direction    = FlowDirection.VerticalOnly,
                            AutoSizeAxes = Axes.Both,
                            Children     = new Framework.Graphics.Drawable[]
                            {
                                new FlowContainer
                                {
                                    Direction    = FlowDirection.HorizontalOnly,
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new[]
                                    {
                                        new SpriteText
                                        {
                                            Text     = beatmap.Version,
                                            TextSize = 20,
                                        },
                                        new SpriteText
                                        {
                                            Text     = $" mapped by {(beatmap.Metadata ?? set.Metadata).Author}",
                                            TextSize = 16,
                                        },
                                    }
                                },
                                new StarCounter {
                                    Count = beatmap.BaseDifficulty?.OverallDifficulty ?? 5, StarSize = 8
                                }
                            }
                        }
                    }
                }
            };
        }
Beispiel #4
0
        public BeatmapSetHeader(BeatmapSetInfo beatmapSet, WorkingBeatmap working)
        {
            Children = new Framework.Graphics.Drawable[]
            {
                working.Background == null ? new Box {
                    RelativeSizeAxes = Axes.Both, Colour = new Color4(20, 20, 20, 255)
                } : new Sprite
                {
                    Texture = working.Background,
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Scale   = new Vector2(1366 / working.Background.Width * 0.6f),
                    Colour  = new Color4(200, 200, 200, 255),
                },
                new FlowContainer
                {
                    Direction = FlowDirection.VerticalOnly,
                    Spacing   = new Vector2(0, 2),
                    Padding   = new MarginPadding {
                        Top = 10, Left = 15, Right = 10, Bottom = 10
                    },
                    AutoSizeAxes = Axes.Both,
                    Children     = new[]
                    {
                        new SpriteText
                        {
                            Font     = @"Exo2.0-SemiBoldItalic",
                            Text     = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode,
                            TextSize = 22
                        },
                        new SpriteText
                        {
                            Font     = @"Exo2.0-MediumItalic",
                            Text     = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode,
                            TextSize = 16
                        },
                        new FlowContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Children     = new[]
                            {
                                new DifficultyIcon(FontAwesome.fa_dot_circle_o, new Color4(159, 198, 0, 255)),
                                new DifficultyIcon(FontAwesome.fa_dot_circle_o, new Color4(246, 101, 166, 255)),
                            }
                        }
                    }
                }
            };

            Deselected();
        }
Beispiel #5
0
            public RingPart()
            {
                Anchor = Anchor.Centre;
                Origin = Anchor.Centre;

                Children = new Framework.Graphics.Drawable[]
                {
                    ring = new Sprite
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                    },
                };
            }
Beispiel #6
0
 private void load()
 {
     Children = new Framework.Graphics.Drawable[]
     {
         //todo: share this more
         new BufferedContainer
         {
             RelativeSizeAxes      = Axes.Both,
             CacheDrawnFrameBuffer = true,
             Children = new Framework.Graphics.Drawable[]
             {
                 new Pulp
                 {
                     RelativePositionAxes = Axes.Both,
                     Anchor       = Anchor.TopCentre,
                     Origin       = Anchor.TopCentre,
                     AccentColour = AccentColour,
                     Scale        = new Vector2(0.6f),
                 },
                 new Pulp
                 {
                     RelativePositionAxes = Axes.Both,
                     Anchor       = Anchor.CentreLeft,
                     Origin       = Anchor.CentreLeft,
                     AccentColour = AccentColour,
                     Y            = -0.08f
                 },
                 new Pulp
                 {
                     RelativePositionAxes = Axes.Both,
                     Anchor       = Anchor.CentreRight,
                     Origin       = Anchor.CentreRight,
                     AccentColour = AccentColour,
                     Y            = -0.08f
                 },
                 new Pulp
                 {
                     RelativePositionAxes = Axes.Both,
                     Anchor       = Anchor.BottomCentre,
                     Origin       = Anchor.BottomCentre,
                     AccentColour = AccentColour,
                 },
             }
         }
     };
 }
Beispiel #7
0
            public ExplodePart()
            {
                Size = new Vector2(144);

                Anchor = Anchor.Centre;
                Origin = Anchor.Centre;

                Additive = true;
                Alpha    = 0;

                Children = new Framework.Graphics.Drawable[]
                {
                    new Triangles
                    {
                        RelativeSizeAxes = Axes.Both,
                    },
                };
            }
Beispiel #8
0
            public ExplodeLayer()
            {
                Size = new Vector2(144);

                Anchor = Anchor.Centre;
                Origin = Anchor.Centre;

                BlendingMode = BlendingMode.Additive;
                Alpha        = 0;

                Children = new Framework.Graphics.Drawable[]
                {
                    new Triangles
                    {
                        RelativeSizeAxes = Axes.Both
                    }
                };
            }
Beispiel #9
0
            public FlashPart()
            {
                Size         = new Vector2(144);
                Masking      = true;
                CornerRadius = Size.X / 2;

                Anchor = Anchor.Centre;
                Origin = Anchor.Centre;

                Additive = true;
                Alpha    = 0;

                Children = new Framework.Graphics.Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                    }
                };
            }
Beispiel #10
0
            public CirclePart()
            {
                Size         = new Vector2(144);
                Masking      = true;
                CornerRadius = DrawSize.X / 2;

                Anchor = Anchor.Centre;
                Origin = Anchor.Centre;

                Children = new Framework.Graphics.Drawable[]
                {
                    disc = new Sprite
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                    },
                    triangles = new Triangles
                    {
                        Additive         = true,
                        RelativeSizeAxes = Axes.Both,
                    },
                };
            }
Beispiel #11
0
        public DrawableCircle(Circle h) : base(h)
        {
            this.h = h;

            Origin   = Anchor.Centre;
            Alpha    = 0;
            Position = h.Position;
            Scale    = new Vector2(0.4f);

            Children = new Framework.Graphics.Drawable[]
            {
                glow = new GlowPart()
                {
                    Colour = h.Colour,
                },
                circle = new CirclePart()
                {
                    Colour = h.Colour,
                    Hit    = delegate { State = ArmedState.Armed; }
                },
                number  = new NumberPart(),
                ring    = new RingPart(),
                flash   = new FlashPart(),
                explode = new ExplodePart()
                {
                    Colour = h.Colour
                },
                approachCircle = new Sprite
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Colour = h.Colour
                }
            };

            Size = new Vector2(100);
        }
Beispiel #12
0
        public DrawableCircle(Circle h) : base(h)
        {
            this.h = h;

            Origin = Anchor.Centre;
            RelativePositionAxes = Axes.Both;
            Position             = new Vector2(h.Position.X / 512, h.Position.Y / 384);

            Children = new Framework.Graphics.Drawable[]
            {
                glow = new GlowLayer
                {
                    Colour = h.Colour
                },
                circle = new CircleLayer
                {
                    Colour = h.Colour,
                    Hit    = Hit,
                },
                number  = new NumberLayer(),
                ring    = new RingLayer(),
                flash   = new FlashLayer(),
                explode = new ExplodeLayer
                {
                    Colour = h.Colour,
                },
                approachCircle = new Sprite
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Colour = h.Colour
                }
            };

            //may not be so correct
            Size = circle.DrawSize;
        }
Beispiel #13
0
        public DrawableSwell(Swell swell)
            : base(swell)
        {
            this.swell = swell;

            Children = new Framework.Graphics.Drawable[]
            {
                bodyContainer = new Container
                {
                    Children = new Framework.Graphics.Drawable[]
                    {
                        expandingRing = new CircularContainer
                        {
                            Name         = "Expanding ring",
                            Anchor       = Anchor.Centre,
                            Origin       = Anchor.Centre,
                            Alpha        = 0,
                            Size         = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
                            BlendingMode = BlendingMode.Additive,
                            Masking      = true,
                            Children     = new []
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Alpha            = inner_ring_alpha,
                                }
                            }
                        },
                        targetRing = new CircularContainer
                        {
                            Name            = "Target ring (thick border)",
                            Anchor          = Anchor.Centre,
                            Origin          = Anchor.Centre,
                            Size            = new Vector2(TaikoHitObject.CIRCLE_RADIUS * 2),
                            Masking         = true,
                            BorderThickness = target_ring_thick_border,
                            BlendingMode    = BlendingMode.Additive,
                            Children        = new Framework.Graphics.Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Alpha            = 0,
                                    AlwaysPresent    = true
                                },
                                new CircularContainer
                                {
                                    Name             = "Target ring (thin border)",
                                    Anchor           = Anchor.Centre,
                                    Origin           = Anchor.Centre,
                                    RelativeSizeAxes = Axes.Both,
                                    Masking          = true,
                                    BorderThickness  = target_ring_thin_border,
                                    BorderColour     = Color4.White,
                                    Children         = new[]
                                    {
                                        new Box
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Alpha            = 0,
                                            AlwaysPresent    = true
                                        }
                                    }
                                }
                            }
                        },
                        circlePiece = new CirclePiece
                        {
                            Children = new []
                            {
                                symbol = new SwellSymbolPiece()
                            }
                        }
                    }
                }
            };

            circlePiece.KiaiMode = HitObject.Kiai;
        }
Beispiel #14
0
        public BeatmapPanel(BeatmapInfo beatmap)
        {
            Beatmap = beatmap;
            Height *= 0.60f;

            Children = new Framework.Graphics.Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                },
                new FlowContainer
                {
                    Padding      = new MarginPadding(5),
                    Direction    = FlowDirection.HorizontalOnly,
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.CentreLeft,
                    Origin       = Anchor.CentreLeft,
                    Children     = new Framework.Graphics.Drawable[]
                    {
                        new DifficultyIcon(FontAwesome.fa_dot_circle_o, new Color4(159, 198, 0, 255))
                        {
                            Scale  = new Vector2(1.8f),
                            Anchor = Anchor.CentreLeft,
                            Origin = Anchor.CentreLeft,
                        },
                        new FlowContainer
                        {
                            Padding = new MarginPadding {
                                Left = 5
                            },
                            Spacing      = new Vector2(0, 5),
                            Direction    = FlowDirection.VerticalOnly,
                            AutoSizeAxes = Axes.Both,
                            Children     = new Framework.Graphics.Drawable[]
                            {
                                new FlowContainer
                                {
                                    Direction    = FlowDirection.HorizontalOnly,
                                    AutoSizeAxes = Axes.Both,
                                    Spacing      = new Vector2(4, 0),
                                    Children     = new[]
                                    {
                                        new SpriteText
                                        {
                                            Font     = @"Exo2.0-Medium",
                                            Text     = beatmap.Version,
                                            TextSize = 20,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                        new SpriteText
                                        {
                                            Font     = @"Exo2.0-Medium",
                                            Text     = "mapped by",
                                            TextSize = 16,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                        new SpriteText
                                        {
                                            Font     = @"Exo2.0-MediumItalic",
                                            Text     = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}",
                                            TextSize = 16,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                    }
                                },
                                new StarCounter {
                                    Count = beatmap.BaseDifficulty?.OverallDifficulty ?? 5, StarSize = 8
                                }
                            }
                        }
                    }
                }
            };
        }