コード例 #1
0
ファイル: Splash.cs プロジェクト: Transfusion/vignette
        private void load(TextureStore textures)
        {
            InternalChildren = new Drawable[]
            {
                new FillFlowContainer
                {
                    Width        = 400,
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    Spacing      = new Vector2(0, 20),
                    AutoSizeAxes = Axes.Y,
                    Direction    = FillDirection.Vertical,
                    Children     = new Drawable[]
                    {
                        branding = new FillFlowContainer
                        {
                            Anchor       = Anchor.Centre,
                            Origin       = Anchor.Centre,
                            AutoSizeAxes = Axes.Both,
                            Direction    = FillDirection.Horizontal,
                            Spacing      = new Vector2(20, 0),
                            Children     = new Drawable[]
                            {
                                new Sprite
                                {
                                    Texture = textures.Get("branding"),
                                    Size    = new Vector2(64),
                                },
                                new Container
                                {
                                    AutoSizeAxes     = Axes.X,
                                    RelativeSizeAxes = Axes.Y,
                                    Child            = new SpriteText
                                    {
                                        Anchor = Anchor.Centre,
                                        Origin = Anchor.Centre,
                                        Font   = Spartan.Bold.With(size: 56),
                                        Text   = "Vignette",
                                    },
                                }
                            }
                        },
                        disclaimer = new TextFlowContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            TextAnchor       = Anchor.TopCentre,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                        }
                    }
                }
            };

            disclaimer.AddText("This project is ", t => t.Font        = SegoeUI.Regular.With(size: 16));
            disclaimer.AddText("under heavy development", t => t.Font = SegoeUI.Bold.With(size: 16));
            disclaimer.AddText(".", t => t.Font = SegoeUI.Regular.With(size: 16));
            disclaimer.NewParagraph();
            disclaimer.AddText("Please direct all bug and crash reports to our GitHub repository.", t => t.Font = SegoeUI.Regular.With(size: 16));
        }
コード例 #2
0
        public EngineDisclaimer(KanojoWorksScreen nextScreen = null)
        {
            this.nextScreen = nextScreen;
            ValidForResume  = false;

            InternalChildren = new Drawable[]
            {
                textFlow = new TextFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    TextAnchor       = Anchor.Centre,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    Spacing          = new Vector2(0, 10),
                    Alpha            = 0
                }
            };

            textFlow.AddText("This game runs on the KanojoWorks engine built on osu!framework.", t => t.Font = KanojoWorksFont.GetFont(size: 30));
            textFlow.NewParagraph();
            textFlow.AddText("KanojoWorks is still a work in progress, so weirdness and bugs may occur.", t => t.Font = KanojoWorksFont.GetFont(size: 30));
        }
コード例 #3
0
ファイル: MainMenu.cs プロジェクト: Transfusion/vignette
        public MainMenu()
        {
            InternalChild = new BackgroundAdjustmentHelper
            {
                OnUserDrag   = handleUserDrag,
                OnUserScroll = handleUserScroll,
                Children     = new Drawable[]
                {
                    blurContainer = new BufferedContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Child            = new Background
                        {
                            RelativeSizeAxes = Axes.Both
                        },
                    },
                    helperInstructions = new Container
                    {
                        Alpha        = 0,
                        Margin       = new MarginPadding(20),
                        Anchor       = Anchor.BottomRight,
                        Origin       = Anchor.BottomRight,
                        AutoSizeAxes = Axes.Both,
                        Masking      = true,
                        CornerRadius = 5.0f,
                        Children     = new Drawable[]
                        {
                            new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                Colour           = Colour4.Black,
                                Alpha            = 0.5f,
                            },
                            new FillFlowContainer
                            {
                                AutoSizeAxes = Axes.Both,
                                Spacing      = new Vector2(0, 20),
                                Direction    = FillDirection.Vertical,
                                Children     = new Drawable[]
                                {
                                    textFlow = new TextFlowContainer
                                    {
                                        AutoSizeAxes = Axes.Both,
                                        TextAnchor   = Anchor.TopLeft,
                                        Margin       = new MarginPadding {
                                            Horizontal = 20, Top = 20
                                        },
                                    },
                                    new ThemedTextButton
                                    {
                                        Width  = 100,
                                        Text   = "Apply",
                                        Action = commitBackgroundAdjustment,
                                        Margin = new MarginPadding {
                                            Horizontal = 20, Bottom = 20
                                        },
                                    }
                                },
                            },
                        },
                    },
                },
            };

            textFlow.AddText("Left Mouse Button ", s => s.Font      = SegoeUI.Black.With(size: 14));
            textFlow.AddText("to move the background.", s => s.Font = SegoeUI.Regular.With(size: 14));
            textFlow.NewParagraph();
            textFlow.AddText("Mouse Scroll ", s => s.Font             = SegoeUI.Black.With(size: 14));
            textFlow.AddText("to resize the background.", s => s.Font = SegoeUI.Regular.With(size: 14));

            AllowBackgroundAdjustments.BindValueChanged(e => helperInstructions.FadeTo(e.NewValue ? 1 : 0, 500, Easing.OutQuint));
        }