private GameObject ShowCard(Card card)
        {
            var obj = CardDisplay.Create(card, new Vector2(-400, -400), false)
                      .Add(o => new DurationTravel
            {
                Duration = TimeSpan.FromMilliseconds(1000),
                Target   = new Transform2 {
                    Size = o.Local.Size, Location = new Vector2(700, 350), ZIndex = o.World.ZIndex
                }
            });

            _registerObj(obj);
            return(obj);
        }
Example #2
0
        public void SelectAction(BattleCharacter src, BattleHand hand, BattleCharacters chars, Action <CardAction> onCardSelected)
        {
            _registerObj(Entity.Create("Player Card Select DropZone", new Transform2 {
                Size = new Size2(1920, 500)
            })
                         .Add(new MouseDropTarget {
                OnDrop = x => CompleteCardSelection(src, chars, x, onCardSelected)
            }));

            var margin = 20;
            var xLoc   = 100;

            hand.Cards.ForEachIndex((x, i) => _registerObj(
                                        CardDisplay.Create(x, new Vector2(xLoc + i * (CardDisplay.Width + margin), 600), hand.Playable.Contains(x))));
        }