コード例 #1
0
        public override void Draw()
        {
            EngineSettings.Graphics.GraphicsDevice.SetRenderTarget(mRenderTarget);

            DrawBackground();

            mSpriteBatch.Begin();

            interactivObject.Draw(mSpriteBatch);
            //mSpriteBatch.Draw(mTexture, new Vector2((EngineSettings.VirtualResWidth / 2 - mTexture.Width / 2), (EngineSettings.VirtualResHeight / 2 - mTexture.Height / 2 )), Color.White);

            mSpriteBatch.Draw(TextureManager.Instance.GetElementByString("pixel"), tmpRectangle, Color.White);

            if (DrawActionRectangle)
            {
                foreach (Rectangle r in interactivObject.ActionRectList)
                {
                    mSpriteBatch.Draw(TextureManager.Instance.GetElementByString("pixel"), r, Color.Yellow * 0.5f);
                }
            }

            if (DrawCollisionRectangle)
            {
                foreach (Rectangle r in interactivObject.CollisionRectList)
                {
                    mSpriteBatch.Draw(TextureManager.Instance.GetElementByString("pixel"), r, Color.Green * 0.5f);
                }
            }

            if (DrawPosition && interactivObject.ActionPosition1 != Vector2.Zero)
            {
                mSpriteBatch.Draw(TextureManager.Instance.GetElementByString("pixel"), interactivObject.ActionPosition1, new Rectangle((int)interactivObject.ActionPosition1.X - 2, (int)interactivObject.ActionPosition1.Y - 2, 5, 5), Color.Blue);
            }
            if (DrawPosition && interactivObject.ActionPosition2 != Vector2.Zero)
            {
                mSpriteBatch.Draw(TextureManager.Instance.GetElementByString("pixel"), interactivObject.ActionPosition2, new Rectangle((int)interactivObject.ActionPosition2.X - 2, (int)interactivObject.ActionPosition2.Y - 2, 5, 5), Color.Blue);
            }

            if (DrawZ && interactivObject.DrawZ > 0)
            {
                mSpriteBatch.Draw(TextureManager.Instance.GetElementByString("pixel"), new Vector2(0, interactivObject.DrawZ), new Rectangle(0, interactivObject.DrawZ, 1024, 1), Color.Red);
            }
            mSpriteBatch.End();

            DrawInfo();

            DrawOnScene();
        }