Esempio n. 1
0
        public UISaveFiles(Transform transform, Screen screen, bool canSave, string title, EventArg onClose) : base(transform, null, screen)
        {
            this.canSave = canSave;
            this.onClose = onClose;

            //Title:
            AddUIElement(new UIText(
                             new Transform(new Vector2(0, -transform.Height / 2f - 25), new Vector2(transform.Width, 50)),
                             ContentHelper.Arial_Font,
                             title,
                             TextAlign.MiddleLeft,
                             5,
                             screen
                             ));

            //Actual column with save files:
            uiSaveFileColumn = AddUIElement(new UIScrollableColumn(
                                                new Transform(transform.Size),
                                                ContentHelper.Box4x4_Sprite,
                                                screen,
                                                new Vector4(5),
                                                new Vector2(5)
                                                ));

            uiSaveFileColumn.SetColor(new Color(56, 56, 56));

            //Close button:
            AddUIElement(new UIButton(
                             new Transform(new Vector2(0, transform.Height / 2f + 40), new Vector2(100, 50)),
                             ContentHelper.Arial_Font,
                             "Close",
                             TextAlign.MiddleCenter,
                             5,
                             ContentHelper.Box4x4_Sprite,
                             onClose,
                             screen
                             )).SetColor(new Color(28, 28, 28));
        }
Esempio n. 2
0
        public override void CreateUI()
        {
            //Background:
            AddUIElement(new UIBackgroundAnimation(
                             new Transform(Alignment.MiddleCenter, GameUIController.WindowSize),
                             ContentHelper.Space_Background_Animation_1,
                             this
                             ));

            //Scrollable column with all the visitables that the player can click on:
            visitablesColumn = AddUIElement(new UIScrollableColumn(
                                                new Transform(Alignment.MiddleCenter, new Vector2(300, 600)),
                                                ContentHelper.Box4x4_Sprite,
                                                this,
                                                new Vector4(5, 0, 5, 0),
                                                new Vector2(0, 5)
                                                ));

            visitablesColumn.SetColor(new Color(56, 56, 56));

            //Back to menu button:
            AddUIElement(new UIButton(
                             new Transform(Alignment.BottomLeft, new Vector2(250, 50)),
                             ContentHelper.Arial_Font,
                             "Menu",
                             TextAlign.MiddleCenter,
                             5,
                             ContentHelper.Box4x4_Sprite,
                             new EventArg1 <EventArg>(GameUIController.CreateMenuScreen, null),
                             this
                             )).SetColor(new Color(28, 28, 28));

            UpdateUIVisitables();

            //Open inventory button:
            AddUIElement(new UIButton(
                             new Transform(Alignment.BottomRight, new Vector2(250, 50)),
                             ContentHelper.Arial_Font,
                             "Inventory",
                             TextAlign.MiddleCenter,
                             5,
                             ContentHelper.Box4x4_Sprite,
                             new EventArg0(ToggeUIInventory),
                             this
                             )).SetColor(new Color(28, 28, 28));

            uiInventory = AddUIElement(new UIInventory(
                                           new Transform(Alignment.MiddleCenter, new Vector2(1210, 600)),
                                           this,
                                           PlayerController.Player.Inventory.Items,
                                           "Inventory",
                                           true,
                                           new EventArg0(ToggeUIInventory)
                                           ));

            uiInventory.Visable = false;

            SetupUIItemsInUIInventory();

            //Add the Top Info bar:
            AddUIElement(new UITopInfo(this));
        }