コード例 #1
0
        public HomeScreen()
        {
            SymcolClickableContainer editorButton;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Blue
                },
                new SpriteText
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,

                    Colour   = Color4.White,
                    TextSize = 24,
                    Text     = "There is no game yet, check back later!"
                },
                editorButton = new SymcolClickableContainer
                {
                    Anchor  = Anchor.BottomRight,
                    Origin  = Anchor.BottomRight,
                    Masking = true,

                    RelativeSizeAxes = Axes.Both,
                    Size             = new Vector2(0.12f, 0.08f),
                    Position         = new Vector2(-10),

                    CornerRadius    = 16,
                    BorderThickness = 4,

                    Children = new Drawable[]
                    {
                        new Box
                        {
                            Colour           = Color4.Red,
                            RelativeSizeAxes = Axes.Both
                        },
                        new SpriteText
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,

                            Colour   = Color4.White,
                            TextSize = 24,
                            Text     = "Editor"
                        }
                    }
                }
            };

            editorButton.Action = () => Push(new EditorScreen());
        }
コード例 #2
0
        public SymcolWindow(Vector2 size)
        {
            Anchor       = Anchor.Centre;
            Origin       = Anchor.Centre;
            CornerRadius = 6;
            Masking      = true;
            AutoSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                topBar = new SymcolContainer
                {
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre,
                    Height = 20,
                    Width  = size.X,

                    Children = new Drawable[]
                    {
                        new Box
                        {
                            Colour           = Color4.Black,
                            RelativeSizeAxes = Axes.Both,
                            Alpha            = 0.5f
                        },
                        WindowTitle = new SpriteText
                        {
                            Anchor   = Anchor.Centre,
                            Origin   = Anchor.Centre,
                            TextSize = 18
                        },
                        new SymcolClickableContainer
                        {
                            Anchor           = Anchor.CentreRight,
                            Origin           = Anchor.CentreRight,
                            RelativeSizeAxes = Axes.Y,
                            Width            = 30,
                            Action           = Close,

                            Child = new Box
                            {
                                Colour           = Color4.Red,
                                RelativeSizeAxes = Axes.Both,
                                Alpha            = 0.5f
                            }
                        },
                        minimize = new SymcolClickableContainer
                        {
                            Anchor           = Anchor.CentreRight,
                            Origin           = Anchor.CentreRight,
                            RelativeSizeAxes = Axes.Y,
                            Width            = 30,
                            Position         = new Vector2(-30, 0),
                            Action           = Minimize,

                            Child = new Box
                            {
                                Colour           = Color4.White,
                                RelativeSizeAxes = Axes.Both,
                                Alpha            = 0.5f
                            }
                        }
                    }
                },
                WindowContent = new SymcolContainer
                {
                    Size   = size,
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre
                }
            };

            WindowContent.Position = new Vector2(0, topBar.Height);
        }