Esempio n. 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;
        }
Esempio n. 2
0
        public ProgressBar(ITextSource hover, Func <int> getValue, Func <int> getMax, int absoluteMax) : base(Handlers)
        {
            _hover       = hover;
            _getValue    = getValue;
            _getMax      = getMax;
            _absoluteMax = absoluteMax;

            _bar   = new UiRectangle(CommonColor.Blue4);
            _frame = new ButtonFrame(_bar)
            {
                State = ButtonState.Pressed, Padding = 0
            };
            Children.Add(_frame);
        }
Esempio n. 3
0
    public ProgressBar(IText hover, Func <int> getValue, Func <int> getMax, int absoluteMax)
    {
        On <HoverEvent>(e => Hover());
        On <BlurEvent>(e => Raise(new HoverTextEvent(null)));

        _hover       = hover;
        _getValue    = getValue;
        _getMax      = getMax;
        _absoluteMax = absoluteMax;

        _bar   = new UiRectangle(CommonColor.Blue4);
        _frame = AttachChild(new ButtonFrame(_bar)
        {
            State = ButtonState.Pressed, Padding = 0
        });
    }
Esempio n. 4
0
        public StatusBarHealthBar(int order, bool isHealth)
        {
            On <PostUpdateEvent>(e => Update());

            _order    = order;
            _isHealth = isHealth;
            _bar      = new UiRectangle(isHealth ? CommonColor.Green5 : CommonColor.Teal3)
            {
                MeasureSize = new Vector2(20, 2)
            };

            _frame = AttachChild(new ButtonFrame(_bar)
            {
                Theme = isHealth
                    ? (ButtonFrame.ThemeFunction)HealthIndicatorTheme
                    : ManaIndicatorTheme,
                Padding = 0
            });
        }
Esempio n. 5
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),
            };
        }