コード例 #1
0
ファイル: CompositeRenderer.cs プロジェクト: cmprog/BeeFree2
 /// <summary>
 /// Renders the entity by drawing the Texture to the entity's position.
 /// </summary>
 /// <param name="entity">The entity to render.</param>
 /// <param name="spriteBatch">The SpriteBatch used to draw with.</param>
 /// <param name="gameTime">The current GameTime.</param>
 public void Render(IRenderableEntity entity, SpriteBatch spriteBatch, GameTime gameTime)
 {
     foreach (var lItem in this.Items)
     {
         spriteBatch.Draw(lItem.Texture, entity.Position + lItem.Offset, lItem.TintColor);
     }
 }
コード例 #2
0
ファイル: AnimatedRenderer.cs プロジェクト: cmprog/BeeFree2
        /// <summary>
        /// Renders the entity by drawing the Texture to the entity's position.
        /// </summary>
        /// <param name="entity">The entity to render.</param>
        /// <param name="spriteBatch">The SpriteBatch used to draw with.</param>
        /// <param name="gameTime">The current GameTime.</param>
        public void Render(IRenderableEntity entity, SpriteBatch spriteBatch, GameTime gameTime)
        {
            spriteBatch.Draw(this.CurrentTexture, entity.Position, Color.White);

            this.CurrentTextureIndex++;
            if (this.CurrentTextureIndex == this.Textures.Count)
            {
                this.CurrentTextureIndex = 0;
            }
        }
コード例 #3
0
ファイル: BasicRenderer.cs プロジェクト: cmprog/BeeFree2
 /// <summary>
 /// Renders the entity by drawing the Texture to the entity's position.
 /// </summary>
 /// <param name="entity">The entity to render.</param>
 /// <param name="spriteBatch">The SpriteBatch used to draw with.</param>
 /// <param name="gameTime">The current GameTime.</param>
 public void Render(IRenderableEntity entity, SpriteBatch spriteBatch, GameTime gameTime)
 {
     spriteBatch.Draw(this.Texture, entity.Position, null, Color.White, 0, Vector2.Zero, this.Scale, SpriteEffects.None, 1);
 }