Ejemplo n.º 1
0
        protected override void BeginDraw()
        {
            // Create the renderer if required (and propagate it)
            if (Renderer == null)
            {
                Renderer = new GameRenderer(Viewport.GameData);

                foreach (ItemButton Button in ContentView.SubviewsOfType <ItemButton>())
                {
                    Button.Renderer = Renderer;
                }
            }

            base.BeginDraw();
        }
Ejemplo n.º 2
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            if (Backbuffer == null)
            {
                Renderer = new GameRenderer(Viewport.GameData);

                Backbuffer = new RenderTarget2D(
                    UIContext.Graphics.GraphicsDevice,
                    480, 352, false,
                    SurfaceFormat.Color, DepthFormat.None, 0,
                    RenderTargetUsage.PreserveContents
                    );
            }

            // Bounds = new Rectangle(0, 0, 883, 883 / 4 * 3);
        }
Ejemplo n.º 3
0
        public ItemButton(GameRenderer Renderer, ClientItem Item)
        {
            this.Item     = Item;
            this.Renderer = Renderer;
            this.Padding  = new Margin
            {
                Top    = -1,
                Right  = 1,
                Bottom = 1,
                Left   = -1
            };

            Bounds.Width  = 34;
            Bounds.Height = 34;

            NormalType    = UIElementType.InventorySlot;
            HighlightType = UIElementType.InventorySlot;
        }