Beispiel #1
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="screen"></param>
        public TestSpriteMaskingScreenView(Screen screen) : base(screen)
        {
            // Create the container to mask its children in
            var maskContainer = new SpriteMaskContainer
            {
                Parent    = Container,
                Alignment = Alignment.MidCenter,
                Size      = new ScalableVector2(200, 200),
                // The MASK image. In this case it's a circle!
                // IMPORTANT! That's why this exists!
                Image      = Textures.CircleMask,
                Animations =
                {
                    new Animation(AnimationProperty.X, Easing.Linear, 0, 300, 5000)
                },
            };

            // Create a new sprite to be contained in the mask.
            maskContainer.AddContainedSprite(new Sprite()
            {
                Parent    = maskContainer,
                Alignment = Alignment.TopLeft,
                Size      = new ScalableVector2(500, 200),
                Image     = WobbleAssets.Wallpaper,
            });

            maskContainer.AddContainedSprite(new SpriteText("exo2-bold", "This is masked!", 16)
            {
                Parent    = maskContainer,
                Alignment = Alignment.MidCenter,
            });
        }
Beispiel #2
0
        /// <summary>
        /// </summary>
        private void CreateBackground()
        {
            var container = new Container(0, 0, Width, 176)
            {
                Parent    = this,
                Alignment = Alignment.TopCenter
            };

            container.AddBorder(Color.White, 2);
            container.Border.Alpha = 1;

            Mask = new SpriteMaskContainer
            {
                Parent    = container,
                Size      = new ScalableVector2(Width - 4, 172),
                Alignment = Alignment.TopCenter,
                Tint      = Color.Black,
                Y         = 2
            };

            Background = new Sprite
            {
                Parent = container,
                Size   = new ScalableVector2(WindowManager.Width / 1.6f, WindowManager.Height / 1.6f),
                Image  = UserInterface.MenuBackground,
                Y      = -100,
                X      = -100
            };

            Mask.AddContainedSprite(Background);
        }
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="view"></param>
        public SelectMapBanner(SelectScreenView view)
        {
            View = view;
            Tint = Color.Black;

            Size = new ScalableVector2(620, 234);
            AddBorder(ColorHelper.HexToColor("#69acc5"), 2);

            Mask = new SpriteMaskContainer()
            {
                Parent    = this,
                Size      = new ScalableVector2(Width - Border.Thickness * 2, Height - Border.Thickness * 2),
                Alignment = Alignment.MidCenter,
                Tint      = Color.Black
            };

            BannerSprite = new Sprite()
            {
                Parent    = this,
                Size      = new ScalableVector2(WindowManager.Width / 1.6f, WindowManager.Height / 1.6f),
                Alignment = Alignment.MidCenter,
                Y         = -80
            };

            Mask.AddContainedSprite(BannerSprite);

            Brightness = new Sprite()
            {
                Parent    = this,
                Size      = Mask.Size,
                Alignment = Alignment.MidCenter,
                Tint      = Color.Black,
                Alpha     = 1
            };

            Container = new ScrollContainer(Size, Size)
            {
                Parent = this,
                Alpha  = 0
            };

            CreateMapDifficultyName();
            CreateSongTitle();
            CreateSongArtist();
            CreateMapCreator();
            CreateRankedStatus();
            CreateMods();
            Metadata = new BannerMetadata(this);

            MapManager.Selected.ValueChanged += OnMapChange;
            ModManager.ModsChanged           += OnModsChanged;
            JudgementWindowsDatabaseCache.Selected.ValueChanged += OnSelectedJudgementsChanged;
            LoadBanner(null);
            UpdateText(MapManager.Selected.Value);
        }