예제 #1
0
        public void DrawWithOutlines(
            Entity entity,
            int headId,
            Vector2 position,
            Color color,
            float rotation,
            float scale,
            SpriteEffects effects)
        {
            if (this._contents[headId] == null)
            {
                this._contents[headId] = new NPCHeadDrawRenderTargetContent();
                this._contents[headId].SetTexture(this._matchingArray[headId].Value);
            }
            NPCHeadDrawRenderTargetContent content = this._contents[headId];

            if (content.IsReady)
            {
                RenderTarget2D target = content.GetTarget();
                Main.spriteBatch.Draw((Texture2D)target, position, new Rectangle?(), color, rotation, target.Size() / 2f, scale, effects, 0.0f);
            }
            else
            {
                content.Request();
            }
        }
        public void DrawWithOutlines(Entity entity, int headId, Vector2 position, Color color, float rotation, float scale, SpriteEffects effects)
        {
            if (_contents[headId] == null)
            {
                _contents[headId] = new NPCHeadDrawRenderTargetContent();
                _contents[headId].SetTexture(_matchingArray[headId].Value);
            }
            NPCHeadDrawRenderTargetContent nPCHeadDrawRenderTargetContent = _contents[headId];

            if (nPCHeadDrawRenderTargetContent.IsReady)
            {
                RenderTarget2D target = nPCHeadDrawRenderTargetContent.GetTarget();
                Main.spriteBatch.Draw(target, position, null, color, rotation, ((Texture2D)target).Size() / 2f, scale, effects, 0f);
            }
            else
            {
                nPCHeadDrawRenderTargetContent.Request();
            }
        }