public BlurView(BufferedContainer buffer, float blur, bool displayEffects, bool synchronisedQuad)
            {
                Size            = new Vector2(200);
                Masking         = true;
                CornerRadius    = 20;
                BorderColour    = Color4.Magenta;
                BorderThickness = 2;

                InternalChildren = new Drawable[]
                {
                    new GridContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Content          = new[]
                        {
                            new Drawable[]
                            {
                                new Container
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Children         = new Drawable[]
                                    {
                                        new Box
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Colour           = Color4.Magenta
                                        },
                                        new SpriteText
                                        {
                                            Anchor = Anchor.Centre,
                                            Origin = Anchor.Centre,
                                            Text   = "You can drag this view.",
                                            Font   = new FontUsage(size: 16),
                                        }
                                    }
                                }
                            },
                            new Drawable[]
                            {
                                new BufferedContainer
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    BackgroundColour = Color4.Black,
                                    BlurSigma        = new Vector2(blur),
                                    Child            = buffer.CreateView().With(d =>
                                    {
                                        d.RelativeSizeAxes       = Axes.Both;
                                        d.SynchronisedDrawQuad   = synchronisedQuad;
                                        d.DisplayOriginalEffects = displayEffects;
                                    })
                                }
                            },
                        },
                        RowDimensions = new[]
                        {
                            new Dimension(GridSizeMode.Absolute, 20),
                        }
                    }
                };
            }
Esempio n. 2
0
 public ToolbarBackground(BufferedContainer screen)
 {
     RelativeSizeAxes = Axes.Both;
     Children         = new Drawable[]
     {
         new BufferedContainer
         {
             RelativeSizeAxes = Axes.Both,
             BackgroundColour = Color4.Black,
             BlurSigma        = new Vector2(15),
             Child            = screen.CreateView().With(d =>
             {
                 d.RelativeSizeAxes     = Axes.Both;
                 d.SynchronisedDrawQuad = true;
             })
         },
         solidBackground = new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = Color4.Black.Opacity(0.2f),
             Alpha            = alpha_normal,
         },
         gradientBackground = new Box
         {
             RelativeSizeAxes = Axes.X,
             Anchor           = Anchor.BottomLeft,
             Alpha            = 0,
             Height           = 90,
             Colour           = ColourInfo.GradientVertical(
                 Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0)),
         },
     };
 }
        private void load()
        {
            Children = new Drawable[]
            {
                buffered = new BufferedContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = new ScreenStack(new BasicMainMenu()),
                },
                settingsContainer = new SettingsContainer
                {
                    Anchor           = Anchor.BottomCentre,
                    Origin           = Anchor.BottomCentre,
                    RelativeSizeAxes = Axes.X,
                    Height           = 360,
                    Y        = 360,
                    Children = new Drawable[]
                    {
                        new BufferedContainer
                        {
                            RelativeSizeAxes = Axes.Both,
                            BlurSigma        = new Vector2(5),
                            Children         = new Drawable[]
                            {
                                buffered.CreateView().With(d =>
                                {
                                    d.RelativeSizeAxes     = Axes.Both;
                                    d.SynchronisedDrawQuad = true;
                                }),
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = Colour4.FromHex("8E8E8E"),
                                    Alpha            = 0.5f
                                },
                            }
                        },
                        new FillFlowContainer
                        {
                            Padding = new MarginPadding {
                                Bottom = 0, Top = 15, Left = 15, Right = 15
                            },
                            Direction = FillDirection.Horizontal,
                            Spacing   = new Vector2(20),
                            Children  = new Drawable[]
                            {
                                new VideoSection(),
                                new AudioSection(),
                                new NovelSection(),
                                new DebugSection()
                            }
                        }
                    }
                }
            };

            settingsContainer.Show();
        }
Esempio n. 4
0
 public TestForm(BufferedContainer buffer)
 {
     Title            = "Draggable Test Form";
     Background.Child = buffer.CreateView().With(d =>
     {
         d.RelativeSizeAxes       = Axes.Both;
         d.DisplayOriginalEffects = true;
         d.SynchronisedDrawQuad   = true;
     });
 }
Esempio n. 5
0
            public Background(BeatmapMeta beatmap = null)
            {
                this.beatmap     = beatmap;
                Depth            = float.MaxValue;
                RelativeSizeAxes = Axes.Both;

                BufferedContainer container = new BufferedContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    Children         = new Drawable[]
                    {
                        sprite = new Sprite
                        {
                            RelativeSizeAxes = Axes.Both,
                            FillMode         = FillMode.Fill,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre
                        },
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Size             = new Vector2(1f, 0.8f),
                            Colour           = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0f))
                        }
                    }
                };

                Children = new Drawable[]
                {
                    container,
                    new BufferedContainer
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = bottom_black_area_height,
                        Origin           = Anchor.BottomCentre,
                        Anchor           = Anchor.BottomCentre,
                        BlurSigma        = new Vector2(10),
                        Child            = container.CreateView().With(d =>
                        {
                            d.RelativeSizeAxes     = Axes.Both;
                            d.SynchronisedDrawQuad = true;
                        })
                    },
                    new Box
                    {
                        RelativeSizeAxes = Axes.X,
                        Height           = bottom_black_area_height,
                        Origin           = Anchor.BottomCentre,
                        Anchor           = Anchor.BottomCentre,
                        Colour           = Color4.Black.Opacity(0.2f)
                    }
                };
            }
Esempio n. 6
0
 private void load(TextureStore store)
 {
     Children = new Drawable[]
     {
         new Container
         {
             RelativeSizeAxes = Axes.Both,
             CornerRadius     = 5,
             Masking          = true,
             EdgeEffect       = new EdgeEffectParameters
             {
                 Colour = Color4.Black.Opacity(40),
                 Type   = EdgeEffectType.Shadow,
                 Offset = new Vector2(0, 2),
                 Radius = 5,
             },
             Children = new Drawable[]
             {
                 new BufferedContainer
                 {
                     RelativeSizeAxes = Axes.Both,
                     BackgroundColour = Color4.Black,
                     BlurSigma        = new Vector2(15),
                     Child            = screen.CreateView().With(d =>
                     {
                         d.RelativeSizeAxes     = Axes.Both;
                         d.SynchronisedDrawQuad = true;
                     })
                 },
                 new Box
                 {
                     Colour           = Color4.Black.Opacity(0.25f),
                     RelativeSizeAxes = Axes.Both,
                 },
                 new Sprite
                 {
                     Texture = store.Get("AcrylicNoise.png"),
                     Colour  = Color4.Black.Opacity(0.05f),
                     Scale   = new Vector2(2)
                 },
                 list = new PlaylistList
                 {
                     RelativeSizeAxes = Axes.Both,
                     Padding          = new MarginPadding {
                         Top = 10, Bottom = 10, Right = 10
                     },
                     Selected     = itemSelected,
                     OrderChanged = (s, i) => OrderChanged?.Invoke(s, i)
                 },
             }
         }
     };
 }
Esempio n. 7
0
        private void load(TextureStore store)
        {
            Children = new Drawable[]
            {
                new BufferedContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    BackgroundColour = Color4.Black,
                    BlurSigma        = new Vector2(5),
                    Child            = background.CreateView().With(d =>
                    {
                        d.RelativeSizeAxes     = Axes.Both;
                        d.SynchronisedDrawQuad = true;
                    })
                },
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.White.Opacity(0.8f)
                },
                new Sprite
                {
                    Texture = store.Get("AcrylicNoise.png"),
                    Colour  = Color4.Black.Opacity(0.05f),
                    Scale   = new Vector2(2)
                },
                new Container
                {
                    Padding          = new MarginPadding(5),
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        textContainer = new TextFlowContainer
                        {
                            Direction = FillDirection.Horizontal
                        }
                    }
                }
            };

            textContainer.AddText(new SpriteText
            {
                Text   = "mapped by ",
                Colour = Color4.Black
            });

            textContainer.AddText(new SpriteTextLink(null)
            {
                Text = beatmap.Metadata.Level.CreatorName
            });
        }
Esempio n. 8
0
            protected override void LoadComplete()
            {
                base.LoadComplete();

                bufferedContainer = new BufferedContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = background = new Sprite
                    {
                        RelativeSizeAxes = Axes.Both,
                        FillMode         = FillMode.Fill,
                        Texture          = WorkingBeatmap.Value?.Background
                    }
                };

                Children = new Drawable[]
                {
                    bufferedContainer,
                    new BufferedContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        BlurSigma        = new osuTK.Vector2(10),
                        Children         = new Drawable[]
                        {
                            bufferedContainer.CreateView().With(d =>
                            {
                                d.RelativeSizeAxes     = Axes.Both;
                                d.SynchronisedDrawQuad = true;
                            }),
                            new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                Colour           = Colour4.Black,
                                Alpha            = 0.6f
                            }
                        }
                    }
                };

                WorkingBeatmap.ValueChanged += beatmapUpdated;
            }
Esempio n. 9
0
        /// <summary>
        /// Blur a Triangle in a cool way!
        /// </summary>
        /// <param name="backBuffer">Background for the Blur as example <see cref="BackgroundImageContainer"/></param>
        /// <param name="blur"></param>
        public BlurredTriangle(BufferedContainer backBuffer, float blur)
        {
            Size    = new Vector2(200);
            Masking = true;

            CornerRadius    = 20;
            BorderColour    = Color4.Magenta;
            BorderThickness = 2;

            InternalChildren = new Drawable[]
            {
                new Triangle
                {
                    //RelativeSizeAxes = Axes.Both,
                    Size   = new Vector2(50),
                    Anchor = Anchor.Centre,
                    Colour = Color4.Red
                },

                new BufferedContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    BlurSigma        = new Vector2(blur),
                    Children         = new Drawable[]
                    {
                        backBuffer
                        .CreateView()
                        .With(d =>
                        {
                            d.RelativeSizeAxes       = Axes.Both;
                            d.SynchronisedDrawQuad   = true;
                            d.DisplayOriginalEffects = true;
                        }),
                    },
                }
            };
        }
Esempio n. 10
0
        private void load(RhythmicStore store)
        {
            Direction    = FillDirection.Vertical;
            Spacing      = new Vector2(0, 10);
            AutoSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                new Container
                {
                    AutoSizeAxes = Axes.Both,
                    CornerRadius = 10,
                    Masking      = true,
                    Children     = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = store.SecondaryColour.Value.Opacity(0.2f)
                        },
                        new BufferedContainer
                        {
                            RelativeSizeAxes = Axes.Both,
                            BackgroundColour = Color4.Black,
                            BlurSigma        = new Vector2(15),
                            Child            = screen.CreateView().With(d =>
                            {
                                d.RelativeSizeAxes     = Axes.Both;
                                d.SynchronisedDrawQuad = true;
                            })
                        },
                        new FillFlowContainer
                        {
                            Direction    = FillDirection.Vertical,
                            Spacing      = new Vector2(0, 20),
                            AutoSizeAxes = Axes.Y,
                            Width        = 300,
                            Padding      = new MarginPadding
                            {
                                Vertical = 20
                            },
                            Children = new Drawable[]
                            {
                                new MenuButton
                                {
                                    Action = () => OnPlay?.Invoke(),
                                    Icon   = FontAwesome.Solid.Play,
                                    Text   = "Play",
                                },
                                new MenuButton
                                {
                                    Action = () => OnEditor?.Invoke(),
                                    Icon   = FontAwesome.Solid.Wrench,
                                    Text   = "Editor"
                                }
                            }
                        }
                    }
                }
            };
        }
Esempio n. 11
0
 public BufferedContainerView <Drawable> CreateView() => globalBufferedContainer?.CreateView().With(d =>
 {
     d.RelativeSizeAxes       = Axes.Both;
     d.SynchronisedDrawQuad   = true;
     d.DisplayOriginalEffects = true;
 });
Esempio n. 12
0
        private void load(TextureStore store, RhythmicStore colourStore)
        {
            Width            = width;
            RelativeSizeAxes = Axes.Y;

            AlwaysPresent = true;

            Children = new Drawable[]
            {
                new BufferedContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    BackgroundColour = Color4.Black,
                    BlurSigma        = new Vector2(15),
                    Child            = screen.CreateView().With(d =>
                    {
                        d.RelativeSizeAxes     = Axes.Both;
                        d.SynchronisedDrawQuad = true;
                    })
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Vertical,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Height           = 0.3f,
                            Colour           = colourStore.SecondaryColour.Value.Opacity(0.3f)
                        },
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Height           = 0.7f,
                            Colour           = ColourInfo.GradientVertical
                                               (
                                colourStore.SecondaryColour.Value.Opacity(0.3f),
                                colourStore.SecondaryColour.Value.Opacity(0.1f)
                                               )
                        }
                    }
                },
                new Sprite
                {
                    Texture = store.Get("AcrylicNoise.png"),
                    Colour  = Color4.Black.Opacity(0.05f),
                    Scale   = new Vector2(2)
                },
                content = new RhythmicScrollContainer
                {
                    Masking          = true,
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        sections = new FillFlowContainer <NotificationSection>
                        {
                            Direction        = FillDirection.Vertical,
                            AutoSizeAxes     = Axes.Y,
                            RelativeSizeAxes = Axes.X,
                            Children         = new[]
                            {
                                new NotificationSection
                                {
                                    Title       = @"Notifications",
                                    ClearText   = @"Clear All",
                                    AcceptTypes = new[] { typeof(SimpleNotification) }
                                },
                                new NotificationSection
                                {
                                    Title       = @"Running Tasks",
                                    ClearText   = @"Cancel All",
                                    AcceptTypes = new[] { typeof(ProgressNotification) }
                                }
                            }
                        }
                    }
                }
            };
        }