Пример #1
0
 public override bool Draw(Batcher2D batcher, int x, int y)
 {
     // sopra
     batcher.Draw2DTiled(_borders[0], x, y, Width, _borderSize, Vector3.Zero);
     // sotto
     batcher.Draw2DTiled(_borders[0], x, y + Height - _borderSize, Width, _borderSize, Vector3.Zero);
     //sx
     batcher.Draw2DTiled(_borders[1], x, y, _borderSize, Height, Vector3.Zero);
     //dx
     batcher.Draw2DTiled(_borders[1], x + Width - _borderSize, y + (_borders[1].Width >> 1), _borderSize, Height - _borderSize, Vector3.Zero);
     return(base.Draw(batcher, x, y));
 }
Пример #2
0
        public override bool Draw(Batcher2D batcher, int x, int y)
        {
            Vector3 hue = Vector3.Zero;

            ShaderHuesTraslator.GetHueVector(ref hue, 0, false, IsTransparent ? Alpha : 0);

            batcher.Draw2DTiled(Texture, x, y, Width, Height, hue);

            return(base.Draw(batcher, x, y));
        }
Пример #3
0
            public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null)
            {
                Vector3 color       = IsTransparent ? ShaderHuesTraslator.GetHueVector(0, false, Alpha, true) : Vector3.Zero;
                int     middleWidth = Width - _gumpTexture[0].Width - _gumpTexture[2].Width;

                batcher.Draw2D(_gumpTexture[0], position, color);
                batcher.Draw2DTiled(_gumpTexture[1], new Rectangle(position.X + _gumpTexture[0].Width, position.Y, middleWidth, _gumpTexture[1].Height), color);
                batcher.Draw2D(_gumpTexture[2], new Point(position.X + Width - _gumpTexture[2].Width, position.Y), color);

                return(base.Draw(batcher, position, hue));
            }
Пример #4
0
        public override bool Draw(Batcher2D batcher, Point position, Vector3?hue = null)
        {
            //int offsetTop = Math.Max(_gumpTexture[0].Height, _gumpTexture[2].Height) - _gumpTexture[1].Height;
            //int offsetBottom = Math.Max(_gumpTexture[5].Height, _gumpTexture[7].Height) - _gumpTexture[6].Height;
            //int offsetLeft = Math.Max(_gumpTexture[0].Width, _gumpTexture[5].Width) - _gumpTexture[3].Width;
            //int offsetRight = Math.Max(_gumpTexture[2].Width, _gumpTexture[7].Width) - _gumpTexture[4].Width;
            Vector3 color = IsTransparent ? ShaderHuesTraslator.GetHueVector(0, false, Alpha, true) : Vector3.Zero;

            for (int i = 0; i < 9; i++)
            {
                SpriteTexture t          = _gumpTexture[i];
                int           drawWidth  = t.Width;
                int           drawHeight = t.Height;
                int           drawX      = position.X;
                int           drawY      = position.Y;

                switch (i)
                {
                case 0:
                    batcher.Draw2D(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 1:
                    drawX    += _gumpTexture[0].Width;
                    drawWidth = Width - _gumpTexture[0].Width - _gumpTexture[2].Width;
                    batcher.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 2:
                    drawX += Width - drawWidth;
                    batcher.Draw2D(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 3:
                    drawY     += _gumpTexture[0].Height;
                    drawHeight = Height - _gumpTexture[0].Height - _gumpTexture[5].Height;
                    batcher.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 4:
                    drawX     += Width - drawWidth /*- offsetRight*/;
                    drawY     += _gumpTexture[2].Height;
                    drawHeight = Height - _gumpTexture[2].Height - _gumpTexture[7].Height;
                    batcher.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 5:
                    drawY += Height - drawHeight;
                    batcher.Draw2D(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 6:
                    drawX    += _gumpTexture[5].Width;
                    drawY    += Height - drawHeight /*- offsetBottom*/;
                    drawWidth = Width - _gumpTexture[5].Width - _gumpTexture[7].Width;
                    batcher.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 7:
                    drawX += Width - drawWidth;
                    drawY += Height - drawHeight;
                    batcher.Draw2D(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;

                case 8:
                    drawX     += _gumpTexture[0].Width;
                    drawY     += _gumpTexture[0].Height;
                    drawWidth  = Width - _gumpTexture[0].Width - _gumpTexture[2].Width;
                    drawHeight = Height - _gumpTexture[2].Height - _gumpTexture[7].Height;
                    batcher.Draw2DTiled(t, new Rectangle(drawX, drawY, drawWidth, drawHeight), color);

                    break;
                }
            }

            //int centerWidth = Width - _gumpTexture[0].Width - _gumpTexture[2].Width;
            //int centerHeight = Height - _gumpTexture[0].Height - _gumpTexture[6].Height;
            //int line2Y = position.Y + _gumpTexture[0].Height;
            //int line3Y = position.Y + Height - _gumpTexture[6].Height;
            //Vector3 color = IsTransparent ? ShaderHuesTraslator.GetHueVector(0, false, Alpha, true) : Vector3.Zero;

            //// top row
            //batcher.Draw2D(_gumpTexture[0], position, color);
            //batcher.Draw2DTiled(_gumpTexture[1], new Rectangle(position.X + _gumpTexture[0].Width, position.Y, centerWidth, _gumpTexture[0].Height), color);
            //batcher.Draw2D(_gumpTexture[2], new Point(position.X + Width - _gumpTexture[2].Width, position.Y), color);

            //// middle
            //batcher.Draw2DTiled(_gumpTexture[3], new Rectangle(position.X, line2Y, _gumpTexture[3].Width, centerHeight), color);
            //batcher.Draw2DTiled(_gumpTexture[4], new Rectangle(position.X + _gumpTexture[3].Width, line2Y, centerWidth, centerHeight), color);
            //batcher.Draw2DTiled(_gumpTexture[5], new Rectangle(position.X + Width - _gumpTexture[5].Width, line2Y, _gumpTexture[5].Width, centerHeight), color);

            //// bottom
            //batcher.Draw2D(_gumpTexture[6], new Point(position.X, line3Y), color);
            //batcher.Draw2DTiled(_gumpTexture[7], new Rectangle(position.X + _gumpTexture[6].Width, line3Y, centerWidth, _gumpTexture[6].Height), color);
            //batcher.Draw2D(_gumpTexture[8], new Point(position.X + Width - _gumpTexture[8].Width, line3Y), color);

            return(base.Draw(batcher, position, hue));
        }
Пример #5
0
 public override bool Draw(Batcher2D batcher, int x, int y)
 {
     return(batcher.Draw2DTiled(Texture, x, y, Percent, Height, ShaderHuesTraslator.GetHueVector(Hue)));
 }