Draw() 공개 메소드

public Draw ( TextureContext texture, Microsoft.Xna.Framework.Graphics.VertexPositionColorTexture vertices, int offset, int count ) : void
texture TextureContext
vertices Microsoft.Xna.Framework.Graphics.VertexPositionColorTexture
offset int
count int
리턴 void
예제 #1
0
        public void Draw(GdxSpriteBatch spriteBatch, float alphaModulation)
        {
            Color oldColor = Color;

            Color = oldColor.MultiplyAlpha(alphaModulation);

            spriteBatch.Draw(Texture, Vertices, 0, 4);

            Color = oldColor;
        }
예제 #2
0
        public override void Draw(GdxSpriteBatch spriteBatch, float x, float y, float width, float height)
        {
            TextureRegion region = Region;

            float regionWidth = region.RegionWidth;
            float regionHeight = region.RegionHeight;
            float remainingX = width % regionWidth;
            float remainingY = height % regionHeight;

            float startX = x;
            float startY = y;
            float endX = x + width - remainingX;
            float endY = y + height - remainingY;

            while (x < endX) {
                y = startY;
                while (y < endY) {
                    spriteBatch.Draw(region, x, y, regionWidth, regionHeight);
                    y += regionHeight;
                }
                x += regionWidth;
            }

            TextureContext texture = region.Texture;
            float u = region.U;
            float v2 = region.V2;

            if (remainingX > 0) {
                float u2 = u + remainingX / texture.Width;
                float v = region.V;

                y = startY;
                while (y < endY) {
                    spriteBatch.Draw(texture, x, y, remainingX, regionHeight, u, v2, u2, v);
                    y += regionHeight;
                }

                if (remainingY > 0) {
                    v = v2 - remainingY / texture.Height;
                    spriteBatch.Draw(texture, x, y, remainingX, remainingY, u, v2, u2, v);
                }
            }

            if (remainingY > 0) {
                float u2 = region.U2;
                float v = v2 - remainingY / texture.Height;

                x = startX;
                while (x < endX) {
                    spriteBatch.Draw(texture, x, y, regionWidth, remainingY, u, v2, u2, v);
                    x += regionWidth;
                }
            }
        }
예제 #3
0
        public void Draw(GdxSpriteBatch spriteBatch, float x, float y, float width, float height)
        {
            float centerColX = x + LeftWidth;
            float rightColX  = x + width - RightWidth;
            float middleRowY = y + BottomHeight;
            float topRowY    = y + height - TopHeight;

            Color color = ColorExt.Multiply(Color, spriteBatch.Color);

            color = Color.FromNonPremultiplied(color.R, color.G, color.B, color.A);

            if (_bottomLeft != -1)
            {
                Set(_bottomLeft, x, y, centerColX - x, middleRowY - y, color);
            }
            if (_bottomCenter != -1)
            {
                Set(_bottomCenter, centerColX, y, rightColX - centerColX, middleRowY - y, color);
            }
            if (_bottomRight != -1)
            {
                Set(_bottomRight, rightColX, y, x + width - rightColX, middleRowY - y, color);
            }
            if (_middleLeft != -1)
            {
                Set(_middleLeft, x, middleRowY, centerColX - x, topRowY - middleRowY, color);
            }
            if (_middleCenter != -1)
            {
                Set(_middleCenter, centerColX, middleRowY, rightColX - centerColX, topRowY - middleRowY, color);
            }
            if (_middleRight != -1)
            {
                Set(_middleRight, rightColX, middleRowY, x + width - rightColX, topRowY - middleRowY, color);
            }
            if (_topLeft != -1)
            {
                Set(_topLeft, x, topRowY, centerColX - x, y + height - topRowY, color);
            }
            if (_topCenter != -1)
            {
                Set(_topCenter, centerColX, topRowY, rightColX - centerColX, y + height - topRowY, color);
            }
            if (_topRight != -1)
            {
                Set(_topRight, rightColX, topRowY, x + width - rightColX, y + height - topRowY, color);
            }

            spriteBatch.Draw(Texture, _vertices, 0, _index);
        }
예제 #4
0
 public void Draw(GdxSpriteBatch spriteBatch, int start, int end)
 {
     spriteBatch.Draw(Font.Region.Texture, Vertices, start * 4, end * 4);
 }
예제 #5
0
 public void Draw(GdxSpriteBatch spriteBatch)
 {
     spriteBatch.Draw(Font.Region.Texture, Vertices, 0, _vertexCount);
 }
예제 #6
0
파일: Image.cs 프로젝트: jaquadro/MonoGdx
        public override void Draw(GdxSpriteBatch spriteBatch, float parentAlpha)
        {
            Validate();

            spriteBatch.Color = Color.MultiplyAlpha(parentAlpha);

            float x = X;
            float y = Y;
            float scaleX = ScaleX;
            float scaleY = ScaleY;

            if (_drawable != null) {
                if (_drawable is TextureRegionDrawable) {
                    TextureRegion region = (Drawable as TextureRegionDrawable).Region;
                    float rotation = Rotation;
                    if (scaleX == 1 && scaleY == 1 && rotation == 0)
                        spriteBatch.Draw(region, x + ImageX, y + ImageY, ImageWidth, ImageHeight);
                    else
                        spriteBatch.Draw(region, x + ImageX, y + ImageY, OriginX - ImageX, OriginY - ImageY, ImageWidth, ImageHeight, scaleX, scaleY, rotation);
                }
                else
                    _drawable.Draw(spriteBatch, x + ImageX, y + ImageY, ImageWidth * scaleX, ImageHeight * scaleY);
            }
        }
예제 #7
0
 public override void Draw(GdxSpriteBatch spriteBatch, float x, float y, float width, float height)
 {
     spriteBatch.Draw(Region, x, y, width, height);
 }
예제 #8
0
 public void Draw(GdxSpriteBatch spriteBatch, int start, int end)
 {
     spriteBatch.Draw(Font.Region.Texture, Vertices, start * 4, end * 4);
 }
예제 #9
0
 public void Draw(GdxSpriteBatch spriteBatch)
 {
     spriteBatch.Draw(Font.Region.Texture, Vertices, 0, _vertexCount);
 }
예제 #10
0
파일: Sprite.cs 프로젝트: jaquadro/MonoGdx
        public void Draw(GdxSpriteBatch spriteBatch, float alphaModulation)
        {
            Color oldColor = Color;
            Color = oldColor.MultiplyAlpha(alphaModulation);

            spriteBatch.Draw(Texture, Vertices, 0, 4);

            Color = oldColor;
        }
예제 #11
0
파일: Sprite.cs 프로젝트: jaquadro/MonoGdx
 public void Draw(GdxSpriteBatch spriteBatch)
 {
     spriteBatch.Draw(Texture, Vertices, 0, 4);
 }
예제 #12
0
        public void Draw(GdxSpriteBatch spriteBatch, float x, float y, float width, float height)
        {
            float centerColX = x + LeftWidth;
            float rightColX = x + width - RightWidth;
            float middleRowY = y + BottomHeight;
            float topRowY = y + height - TopHeight;

            Color color = ColorExt.Multiply(Color, spriteBatch.Color);
            color = Color.FromNonPremultiplied(color.R, color.G, color.B, color.A);

            if (_bottomLeft != -1)
                Set(_bottomLeft, x, y, centerColX - x, middleRowY - y, color);
            if (_bottomCenter != -1)
                Set(_bottomCenter, centerColX, y, rightColX - centerColX, middleRowY - y, color);
            if (_bottomRight != -1)
                Set(_bottomRight, rightColX, y, x + width - rightColX, middleRowY - y, color);
            if (_middleLeft != -1)
                Set(_middleLeft, x, middleRowY, centerColX - x, topRowY - middleRowY, color);
            if (_middleCenter != -1)
                Set(_middleCenter, centerColX, middleRowY, rightColX - centerColX, topRowY - middleRowY, color);
            if (_middleRight != -1)
                Set(_middleRight, rightColX, middleRowY, x + width - rightColX, topRowY - middleRowY, color);
            if (_topLeft != -1)
                Set(_topLeft, x, topRowY, centerColX - x, y + height - topRowY, color);
            if (_topCenter != -1)
                Set(_topCenter, centerColX, topRowY, rightColX - centerColX, y + height - topRowY, color);
            if (_topRight != -1)
                Set(_topRight, rightColX, topRowY, x + width - rightColX, y + height - topRowY, color);

            spriteBatch.Draw(Texture, _vertices, 0, _index);
        }
예제 #13
0
 public void Draw(GdxSpriteBatch spriteBatch)
 {
     spriteBatch.Draw(Texture, Vertices, 0, 4);
 }