예제 #1
0
        public override void Draw(GameTime gameTime, RenderEngine renderer)
        {
            //Choose Icon texture based on current action
            if (Action is PhaseAction)
            {
                Texture2D texture = (((PhaseAction)Action).Phase == Phases.Cleanup) ? TurnSymbol : PhaseSymbol;
                renderer.AddOutlineTask(texture, new Vector2(X + 5f, Y + 5f), texture.Size, Color4.White, 0f, Vector2.Zero, iconBorderColor);
            }
            else if (Action is CardCastAction)
            {
                Texture2D texture = ((CardCastAction)Action).Card.Art;
                renderer.AddOutlineTask(texture, new Vector2(X + 5f, Y + 5f), new Vector2(40f, 40f), Color4.White, new RectangleF(71f, 51f, 142f, 142f), iconBorderColor);
            }
            else if (Action is AbilityAction)
            {
                Texture2D texture = ((AbilityAction)Action).Card.Art;
                renderer.AddOutlineTask(texture, new Vector2(X + 5f, Y + 5f), new Vector2(40f, 40f), Color4.White, new RectangleF(71f, 51f, 142f, 142f), iconBorderColor);
            }

            //Adjust textbox position to be offset from the icon
            textBox.X = 50f;
            textBox.Y = (int)(Height / 2f - textBox.Height / 2f);

            base.Draw(gameTime, renderer);
        }
예제 #2
0
        public override void Draw(GameTime gameTime, RenderEngine renderer)
        {
            if (Card == null)
            {
                return;
            }

            float rotation = (Card.IsTapped) ? 1.571f : 0f;

            if (IgnoreCardStates)
            {
                renderer.AddRenderTask(Card.Art, Position, Size, 0f, new Vector2(0.5f, 0.5f), Color4.White);
            }
            else if (Hovered)
            {
                renderer.AddOutlineTask(Card.Art, Position, Size, HoveredColor, rotation, new Vector2(0.5f, 0.5f), OutlineHovered);
            }
            else if (Card.IsValidTarget)
            {
                renderer.AddOutlineTask(Card.Art, Position, Size, HighlightedColor, rotation, new Vector2(0.5f, 0.5f), OutlineHighlighted);
            }
            else
            {
                renderer.AddRenderTask(Card.Art, Position, Size, rotation, new Vector2(0.5f, 0.5f), Color4.White);
            }


            //If the card is face down, add a half-transparent card back texture over it
            if (Card.IsFaceDown && !IgnoreCardStates)
            {
                if (Hovered)
                {
                    Color4 outlineColor = (Card.IsValidTarget) ? OutlineHighlighted : OutlineHovered;
                    renderer.AddOutlineTask(CardInfo.CardBack, Position, Size, new Color4(1f, 1f, 1f, 0.85f), rotation, new Vector2(0.5f, 0.5f), outlineColor, -0.1f);
                }
                else
                {
                    renderer.AddRenderTask(CardInfo.CardBack, Position, Size, rotation, new Vector2(0.5f, 0.5f), new Color4(1f, 1f, 1f, 0.85f), -0.1f);
                }
            }

            base.Draw(gameTime, renderer);
        }