Beispiel #1
0
        protected override void DrawOther()
        {
            base.DrawOther();

            //Draw the spark animation if it's playing
            if (SparkAnimation.IsPlaying == true)
            {
                SparkAnimation.Draw(Position, TintColor, Rotation, Vector2.Zero, Vector2.One, false, .11f);
            }

            //DrawHitbox();
        }
        public override void Draw()
        {
            //List out actions with their name, icon, description, and FP cost
            for (int i = 0; i < BattleActions.Count; i++)
            {
                MoveAction moveAction = BattleActions[i];

                float alphaMod = 1f;

                Vector2 pos       = Position + new Vector2(0, i * YSpacing);
                Color   color     = moveAction.Disabled == false ? MoveAction.EnabledColor : MoveAction.DisabledColor;
                Color   textColor = moveAction.Disabled == false ? MoveAction.TextEnabledColor : MoveAction.TextDisabledColor;
                if (CurSelection != i || BattleUIManager.Instance.TopMenu != this)
                {
                    alphaMod = MoveAction.UnselectedAlpha;
                }

                //Draw all information including name and FP cost
                moveAction.DrawMenuInfo(pos, color, textColor, alphaMod, IconXOffset, ResourceCostXOffset);
            }

            //Show description window at the bottom
            BoxMenu.Draw();

            //Draw the selection cursor
            SelectionCursor.Draw(Position + new Vector2(-(IconXOffset * 2), CurSelection * YSpacing), Color.White, 0f, Vector2.Zero, new Vector2(2f, 2f), false, .38f);

            //Draw the menu background
            SpriteRenderer.Instance.DrawUISliced(MenuBG, new Rectangle((int)(Position.X - IconXOffset) - 6, (int)(Position.Y - (YSpacing / 2)), (int)(ResourceCostXOffset + (IconXOffset * 3)), (int)((BattleActions.Count * YSpacing) + (YSpacing))),
                                                 Color.White, .35f);

            //Draw the header
            Vector2   headerOffset = new Vector2(HeaderSize.X / 2, HeaderSize.Y / 2);
            Vector2   headerPos    = new Vector2((int)(Position.X + (ResourceCostXOffset / 2f)), (int)(Position.Y - YSpacing) + (YSpacing / 4)) - headerOffset;
            Rectangle headerRect   = new Rectangle((int)headerPos.X, (int)headerPos.Y, (int)HeaderSize.X, (int)HeaderSize.Y);

            SpriteRenderer.Instance.DrawUISliced(HeaderImage, headerRect, Color.Blue, .42f);

            Vector2 fontSize = AssetManager.Instance.TTYDFont.MeasureString(Name);
            Vector2 diff     = new Vector2((HeaderSize.X - fontSize.X) / 2, ((HeaderSize.Y - fontSize.Y) / 2) + (fontSize.Y / 4));

            SpriteRenderer.Instance.DrawUIText(AssetManager.Instance.TTYDFont, Name, headerPos + diff, Color.White, 0f, Vector2.Zero, 1f, .43f);
        }