コード例 #1
0
ファイル: Game1.cs プロジェクト: Lambparade/Simple-Legends
        protected override void Draw(GameTime gameTime)
        {
            ///MOVE RENDERTARGET TO DIFFERNET CLASS
            GraphicsDevice.Clear(Color.Black);

            InActiveEntityDrawManager.SendToRenderSystem();
            ActiveEntityDrawManager.SendToRenderSystem();

            RenderTarget2D GameRenderTarget = new RenderTarget2D(GraphicsDevice, 512, 512);

            GraphicsDevice.SetRenderTarget(GameRenderTarget);

            GraphicsDevice.Clear(Color.Black);

            SpriteBatch RenderspriteBatch = new SpriteBatch(GraphicsDevice);

            RenderSprites.Draw(RenderspriteBatch, GraphicsDevice);

            GraphicsDevice.SetRenderTarget(null);

            spriteBatch.Begin();

            spriteBatch.Draw(GameRenderTarget, new Vector2(0, 0), Color.White);

            spriteBatch.End();

            base.Draw(gameTime);
        }
コード例 #2
0
ファイル: Grid.cs プロジェクト: Lambparade/Simple-Legends
        public Grid(GameTexture GridTexture, Position GridPosition, bool isInCameraWorld) : base(isInCameraWorld)
        {
            GamePosition = new Position(GridPosition.Location.X, GridPosition.Location.Y);

            Graphic = new Sprite(GridTexture, GamePosition, 1.0f);

            InActiveEntityDrawManager.AddToRenderQueue(this);
        }