Exemplo n.º 1
0
        public void Render(CardRenderWindow handle)
        {
            List<Vector2> cardPos = new List<Vector2>();
            Vector2 current = Position.Clone() as Vector2;
            for (int i = 0; i < InnerPile.Count; i += CARDS_PER_IMG)
            {
                cardPos.Add(current.Clone() as Vector2);

                current.X += OFFSET_PER_CARD / 2;
                current.Y += OFFSET_PER_CARD;
            }

            for (int i = cardPos.Count - 1; i >= 0; i--)
            {
                IGraphic back = new ImageGraphic(BACK_FILENAME);
                handle.RenderImage(back, cardPos[i]);
            }
        }
Exemplo n.º 2
0
 public void Render(CardRenderWindow handle)
 {
     handle.RenderImage(Image, Position);
 }
Exemplo n.º 3
0
        public override void Run(params string[] args)
        {
            GrabInput();

            RenderWindow = ViewModel.LaunchCardWindow(this);
        }
Exemplo n.º 4
0
        public CardRenderWindow LaunchCardWindow(CmdCards cmd)
        {
            CardRenderWindow res = null;

            cardWindowThread = new Thread(() =>
            {
                CardRenderWindow crw = new CardRenderWindow(cmd, this);
                res = crw;
                crw.Closed += (sender, e) =>
                {
                    crw.Dispatcher.InvokeShutdown();
                    cmd.ReleaseInput();
                };

                crw.Show();
                System.Windows.Threading.Dispatcher.Run();
            });

            cardWindowThread.SetApartmentState(ApartmentState.STA);
            cardWindowThread.Start();

            Window.Dispatcher.Invoke(PrintingFormatted, "&e&*Starting Window...\r");

            while (res == null) // sorta hacky workaround
            {
                Thread.Sleep(1); // prevent excessive memory use
            }

            return res;
        }
Exemplo n.º 5
0
 public void Render(CardRenderWindow handle)
 {
     IGraphic img = new ImageGraphic(InternalCard.ImagePath());
     handle.RenderImage(img, Position);
 }
Exemplo n.º 6
0
 // ============================ //
 public CardGame(CardRenderWindow window)
 {
     Handle = window;
 }