예제 #1
0
 protected override SpriteText CreatePlaceholder() => new SpriteText
 {
     Colour = new Color4(255, 255, 255, 0.5f),
     Margin = new MarginPadding {
         Left = 2
     },
     Font = TCCFont.GetFont()
 };
예제 #2
0
        private void load()
        {
            anchorPosition = Anchor;

            float xPositionBox = anchorPosition != Anchor.Centre ?
                                 anchorPosition == Anchor.CentreLeft ?
                                 -1 * (800 / 2) : (800 / 2) : 0;
            float xSize = 801 / 3;

            AddInternal(
                ItemBox = new Box
            {
                Size     = new osuTK.Vector2(x: xSize, y: 111),
                Anchor   = Anchor.Centre,
                Origin   = anchorPosition,
                Position = new osuTK.Vector2(x: xPositionBox, y: 0),
                Colour   = DisplayColour,
            }
                );



            AddInternal(
                PackSpriteText = new SpriteText
            {
                Text   = DisplayName.ToUpper(),
                Font   = TCCFont.GetFont(weight: FontWeight.Medium, size: 49),
                Anchor = anchorPosition,
                Origin = Anchor.Centre,
            }
                );

            AddInternal(
                PackSizeSpriteText = new SpriteText
            {
                Text   = SizeConvert.SizeSuffix(PackSize),
                Font   = TCCFont.GetFont(weight: FontWeight.Thin, size: 49),
                Anchor = anchorPosition,
                Origin = Anchor.Centre,
            }
                );
            // Positions, since the only way to make sure it's in the middle of the box,
            // is to calculate the draw width, which is after the entire shape is loaded.
            PackSpriteText.Position =
                new osuTK.Vector2(
                    x: (ItemBox.DrawWidth / 2) * (anchorPosition == Anchor.Centre ? 0 : anchorPosition == Anchor.CentreLeft ? 1 : -1),
                    y: PackSizeSpriteText.DrawHeight / 2 * -1);
            PackSizeSpriteText.Position =
                new osuTK.Vector2(
                    x: (ItemBox.DrawWidth / 2) * (anchorPosition == Anchor.Centre ? 0 : anchorPosition == Anchor.CentreLeft ? 1 : -1),
                    y: PackSpriteText.DrawHeight / 2);
        }
예제 #3
0
        private void load()
        {
            RelativeSizeAxes = Axes.None;
            selectedPack     = MainScreen.CustomPackBindable.Value;
            // Masking Container for Round Corners at 0

            AddInternal(new SpriteText
            {
                Text     = "Choose Your Pack".ToUpper(),
                Font     = TCCFont.GetFont(Typeface.Ageo, 29, FontWeight.Regular),
                Position = new Vector2(0, -230),
                Anchor   = Anchor.Centre,
                Origin   = Anchor.Centre
            });
            AddInternal(new Container
            {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Position         = new Vector2(0, -160),
                Masking          = true,
                RelativeSizeAxes = Axes.Both,
                CornerRadius     = 10,
                Children         = new Drawable[]
                {
                    new PackItemComponent
                    {
                        DisplayName      = "Minimum",
                        DisplayColour    = new Color4(0, 1, 0, 0.7f),
                        Anchor           = Anchor.CentreLeft,
                        Origin           = Anchor.CentreLeft,
                        RelativeSizeAxes = Axes.Both,
                        PackSize         = 100000000, // 100 mb
                    }, new PackItemComponent
                    {
                        DisplayName      = "Standart",
                        DisplayColour    = new Color4(0, 0, 1, 0.7f),
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.Both,
                        PackSize         = 700000000, // 700 mb
                    }, new PackItemComponent
                    {
                        DisplayName      = "Deluxe",
                        DisplayColour    = new Color4(1, 0, 0, 0.7f),
                        Anchor           = Anchor.CentreRight,
                        Origin           = Anchor.CentreRight,
                        RelativeSizeAxes = Axes.Both,
                        PackSize         = 1400000000, // 1.4 GB
                    }
                }
            });
        }
예제 #4
0
        private void load(LargeTextureStore textureStore)
        {
            Texture folderButton = textureStore.Get("Folder Button");

            Size = folderButton.Size;

            sizeText = new SpriteText
            {
                Text     = $"Free Size: {SizeConvert.SizeSuffix(driveInfoBindable.Value.AvailableFreeSpace)}",
                Origin   = Anchor.CentreRight,
                Anchor   = Anchor.CentreRight,
                Font     = TCCFont.GetFont(Typeface.Ageo, size: 22, weight: FontWeight.Thin),
                Position = new Vector2(-1 * (20 + (folderButton.Size.X / 2)), 0)
            };
            AddInternal(sizeText);

            driveInfoBindable.ValueChanged += DriveInfoBindable_ValueChanged;
        }