示例#1
0
        public ItemInventory(ItemScreen ui, UiSkinComponent skin, Texture2D texture, int x, int y, int width, int height, float sourceScale) : base(texture, x, y, width, height, sourceScale)
        {
            _itemui       = ui;
            TopRect       = new UiRectangle(this, skin.GetSkin("test"), PanelExt.SizeToBounds(Bounds, 0f, 0f, 1f, 0.1f), 0.5f);
            TopRect.Color = Microsoft.Xna.Framework.Color.Silver;


            _itemText = new TextPanel(this, ui.ParantMenu.StandardFont, "Item", TextSortMode.LEFT)
            {
                Color    = Color.Black,
                Position = PanelExt.PositionToBounds(TopRect.Bounds, 0.05f, 0.5f)
            };


            PanelGrid = new GridPanel(this, 4, 4, PanelExt.SizeToBounds(Bounds, 0f, 0.1f, 1f, 0.9f), 10, 10);
            for (int i = 0; i < 16; i++)
            {
                PanelGrid.AddGridChilde(new UiRectangle(skin.GetSkin("item"), new Rectangle(0, 0, 100, 100), 2)
                {
                    PanelCode = i
                });
            }

            _exit = new ImagePanel(this, "UI\\exit");
            _exit.SetPosition(PanelExt.PositionToBounds(Bounds, 0.95f, 0.05f));
            _exit.Scale = 1.5f;
            _exit.Recalculate();

            SelectOnEvent += ItemPanel_SelectOnEvent;
        }
示例#2
0
        public StatusScreen(Data data, PlayUI parant) : base(data, parant)
        {
            HpBar     = new BarHp(data, this);
            AirBar    = new BarAir(data, this);
            MentalBar = new BarMental(data, this);
            ExtBar    = new BarExp(data, this);

            _Uiclass = new UiRectangle(ParantMenu.UISkin.GetSkin("test"), new Rectangle(ExtBar.Bounds.Left - 200, ExtBar.Bounds.Bottom - 100, 200, 100), 0.5f);
            AddSprite(_Uiclass);

            ClassName = new TextPanel(_Uiclass, parant.StandardFont, "Class", TextSortMode.MIDDLE)
            {
                Position = PanelExt.PositionToBounds(_Uiclass.Bounds, 0.5f, 0.5f),
            };


            _CraftMode = new UiRectangle(ParantMenu.UISkin.GetSkin("test"), new Rectangle(ExtBar.Bounds.Right, ExtBar.Bounds.Bottom - 100, 200, 100), 0.5f);
            AddSprite(_CraftMode);

            new TextPanel(_CraftMode, parant.StandardFont, "CraftMode", TextSortMode.MIDDLE)
            {
                Position = PanelExt.PositionToBounds(_CraftMode.Bounds, 0.5f, 0.5f),
            };
        }