コード例 #1
0
        public FrameTable(Vector2 position) : base(position)
        {
            snap        = new CircleSnap(Arranger.staticPoint(0.5f, 0.5f), (ScaleManager.CardScale * 64f / 2f) + (ScaleManager.CardScaleSmall * (64f / 2f + 13f)));
            trumpOffset = Arranger.staticPoint(0.5f, 0.5f);
            LinePoly tableTabPoly = new LinePoly(
                Vector2.Zero,
                new Vector2(29, 0),
                new Vector2(29, 5),
                new Vector2(20, 16),
                new Vector2(-20, 16),
                new Vector2(-29, 5),
                new Vector2(-29, 0)
                );

            tableTab = new PolyButton(Arranger.staticPoint(3 / 4f, 1f), tableTabPoly, ContentStore.tableTab, new Vector2(27, 0), ScaleManager.CardScale, 0f);
            LinePoly handTabPoly = new LinePoly(
                Vector2.Zero,
                new Vector2(29, 0),
                new Vector2(29, -5),
                new Vector2(20, -16),
                new Vector2(-20, -16),
                new Vector2(-29, -5),
                new Vector2(-29, -0)
                );

            handTab    = new PolyButton(Arranger.staticPoint(3 / 4f, 1f), handTabPoly, ContentStore.handTab, new Vector2(27, 14), ScaleManager.CardScale, 0f);
            tablePatch = ContentStore.tablePatch;
            namePlates = new List <NamePlate>();
        }
コード例 #2
0
        public void setUp()
        {
            ICollection <Player> playerList = ClientDataStore.Instance.Players;

            foreach (Player player in playerList)
            {
                NineGridRow row        = scoreboard.addRow(player.ID.ToString());
                NineCell    playerCell = row.getCell("player");
                string      nameText   = player.Name;
                if (nameText.Length > 12)
                {
                    nameText = nameText.Substring(0, 10) + "...";
                }
                playerCell.Text   = nameText;
                playerCell.Colour = ColourHelper.getPlayerColour(player.ID, playerList.Count);
                NineCell scoreCell = row.getCell("score");
                scoreCell.Text      = "0";
                scoreCell.Alignment = 'C';
                NineCell bidCell = row.getCell("bid");
                bidCell.Text      = "-";
                bidCell.Alignment = 'C';
                NineCell trickCell = row.getCell("tricks");
                trickCell.Text      = "0";
                trickCell.Alignment = 'C';
            }
            scoreboard.blink(new Vector2(scoreboard.Position.X, 0f));
            scoreTab.blink(new Vector2(scoreTab.Position.X, scoreboard.Height));
            stowPosition    = Arranger.staticPoint(0f, 0f);
            stowPosition.Y -= scoreboard.Height;
            patchPos        = scoreboard.Position.ToPoint();
            patchSize       = new Point(69 * ScaleManager.InterfaceScale, scoreboard.Height);
            patchPos.X      = (int)((scoreTab.Position.X - (32.5f * ScaleManager.InterfaceScale)) + 0.5f);
        }
コード例 #3
0
ファイル: PlayerIndicator.cs プロジェクト: liangyee/Wizard
 public PlayerIndicator(Vector2 position) : base(position)
 {
     offset     = Arranger.staticPoint(0f, 0.5f);
     indicator  = ContentStore.playerIndicator;
     glow       = ContentStore.playerIndicatorGlow;
     indOrigin  = new Vector2(0f, 7.5f);
     glowOrigin = new Vector2(0f, 10.5f);
 }
コード例 #4
0
 public ParallaxBackground(Vector2 position) : base(position)
 {
     tablePoint = new ParallaxPoint(Arranger.staticPoint(0.5f, 0f), 0);
     couchPoint = new ParallaxPoint(Arranger.staticPoint(0.5f, 1f), 4);
     legLPoint  = new ParallaxPoint(Arranger.staticPoint(0f, 0f), 5);
     legRPoint  = new ParallaxPoint(Arranger.staticPoint(1f, 0f), 5);
     armLPoint  = new ParallaxPoint(Arranger.staticPoint(0f, 1f), 2);
     armRPoint  = new ParallaxPoint(Arranger.staticPoint(1f, 1f), 2);
 }
コード例 #5
0
ファイル: PageTutorial.cs プロジェクト: liangyee/Wizard
        public PageTutorial(MainGame mainGame) : base(mainGame)
        {
            whiteout = new Texture2D(mainGame.GraphicsDevice, 1, 1);
            whiteout.SetData <Color>(new Color[] { Color.White });
            slides  = new Texture2D[14];
            anchors = new SlideAnchor[14];
            for (int i = 1; i <= 14; i++)
            {
                slides[i - 1]  = mainGame.Content.Load <Texture2D>("tutorial\\Tutorial_A" + i.ToString() + ".png");
                anchors[i - 1] = new SlideAnchor(Arranger.staticPoint(0.5f, 0.5f));
                addMovable(anchors[i - 1]);
            }
            leftArrow  = mainGame.Content.Load <Texture2D>("tutorial\\arrowLeft.png");
            rightArrow = mainGame.Content.Load <Texture2D>("tutorial\\arrowRight.png");

            scale     = (float)screenSize.Y / (float)slides[0].Height;
            texCentre = new Vector2(slides[0].Width / 2f, slides[0].Height / 2f);

            Arranger arranger = new Arranger(true, 3, 'R', ScaleManager.InterfaceScale * 2);

            LinePoly backPoly = new LinePoly(
                Vector2.Zero,
                new Vector2(-9.5f, -10f),
                new Vector2(9.5f, -10f),
                new Vector2(9.5f, 10f),
                new Vector2(-9.5f, 10f)
                );

            navigateBack = new PolyButton(Vector2.Zero, backPoly, leftArrow, new Vector2(7.5f, 8f), ScaleManager.CardScale, 0f);
            arranger.addObject(navigateBack, 0);
            addMovable(navigateBack);

            LinePoly fwdPoly = new LinePoly(
                Vector2.Zero,
                new Vector2(-9.5f, -10f),
                new Vector2(9.5f, -10f),
                new Vector2(9.5f, 10f),
                new Vector2(-9.5f, 10f)
                );

            navigateForward = new PolyButton(Vector2.Zero, fwdPoly, rightArrow, new Vector2(7.5f, 8f), ScaleManager.InterfaceScale, 0f);
            arranger.addObject(navigateForward, 2);
            addMovable(navigateForward);

            backButton = new PatchButton(5, Vector2.Zero, ContentStore.standardPatch, ScaleManager.InterfaceScale, "Back", () => {
                AudioHelper.play(ContentStore.soundPop);
                mainGame.menuController.changeActivePage(mainGame.mainMenu);
            });
            addButton(backButton);
            arranger.addObject(backButton, 1);

            arranger.performArrangements();
        }
コード例 #6
0
        public void setUp()
        {
            blackout = new Texture2D(MainGame.Instance.GraphicsDevice, 1, 1);
            blackout.SetData <Color>(new Color[] { Color.Black });

            ICollection <Player> playerList = ClientDataStore.Instance.Players;

            for (int i = 0; i < playerList.Count; i++)
            {
                scoreboard.addRow(i.ToString());
            }
            Arranger arranger = new Arranger(true, 1, 'C', 0);

            arranger.addObject(scoreboard, 0);
            arranger.performArrangements();
            GameClient.Instance.frameController.editStow(this, Arranger.staticPoint(0f, 1f));
        }
コード例 #7
0
ファイル: PageTutorial.cs プロジェクト: liangyee/Wizard
        public override void update(GameTime gameTime)
        {
            base.update(gameTime);
            for (int i = 0; i < 14; i++)
            {
                if (i == index)
                {
                    anchors[i].moveTo(position + Arranger.staticPoint(0.5f, 0.5f), ScaleManager.InterfaceScale);
                }
                else if (i > index)
                {
                    anchors[i].moveTo(position + Arranger.staticPoint(1.5f, 0.5f), ScaleManager.InterfaceScale);
                }
                else if (i < index)
                {
                    anchors[i].moveTo(position + Arranger.staticPoint(-0.5f, 0.5f), ScaleManager.InterfaceScale);
                }
            }

            foreach (GestureSample gesture in GestureManager.Gestures)
            {
                if (gesture.GestureType == GestureType.Tap)
                {
                    if (navigateBack.checkForHit(gesture.Position))
                    {
                        if (index != 0)
                        {
                            AudioHelper.play(ContentStore.soundRoll);
                            index--;
                        }
                    }
                    if (navigateForward.checkForHit(gesture.Position))
                    {
                        if (index != 13)
                        {
                            AudioHelper.play(ContentStore.soundRoll);
                            index++;
                        }
                    }
                }
            }
        }
コード例 #8
0
ファイル: FrameHand.cs プロジェクト: liangyee/Wizard
        public FrameHand(Vector2 position) : base(position)
        {
            hand       = new CardContainer();
            handSnap   = new CardSnap(new Vector2(0, screenSize.Y), (float)screenSize.X, false);
            dropZone   = new DropZone(Arranger.staticPoint(0.5f, 0.25f), Arranger.staticPoint(1f, 0.5f), dropZoneAction);
            table      = new QuickCardTable(new Vector2(screenSize.X / 2f, screenSize.Y / 4f), new Vector2(screenSize.X, screenSize.Y / 2f));
            clientData = ClientDataStore.Instance;
            clientData.LeadSuitChanged += new ClientDataStore.LeadSuitChangedHandler(leadSuitChanged);

            LinePoly tableTabPoly = new LinePoly(
                Vector2.Zero,
                new Vector2(29, 0),
                new Vector2(29, 5),
                new Vector2(20, 16),
                new Vector2(-20, 16),
                new Vector2(-29, 5),
                new Vector2(-29, 0)
                );

            tableTab = new PolyButton(Arranger.staticPoint(3 / 4f, 1f), tableTabPoly, ContentStore.tableTab, new Vector2(27, 0), ScaleManager.CardScale, 0f);
        }
コード例 #9
0
        public FrameScoreboard(Vector2 position) : base(position)
        {
            scoreboard = new NineGrid(Vector2.Zero, ScaleManager.InterfaceScale, ScaleManager.LargeFont, new string[] { "player", "score", "bid", "tricks" }, new int[] { 12, 6, 4, 4 });
            NineGridRow header     = scoreboard.addRow("header");
            NineCell    playerCell = header.getCell("player");

            playerCell.Text      = "Player";
            playerCell.Alignment = 'C';
            NineCell scoreCell = header.getCell("score");

            scoreCell.Text      = "Score";
            scoreCell.Alignment = 'C';
            NineCell bidCell = header.getCell("bid");

            bidCell.Text      = "Bid";
            bidCell.Alignment = 'C';
            NineCell trickCell = header.getCell("tricks");

            trickCell.Text      = "Won";
            trickCell.Alignment = 'C';
            LinePoly scoreTabPoly = new LinePoly(
                Vector2.Zero,
                new Vector2(34.5f, 0),
                new Vector2(34.5f, 5),
                new Vector2(25.5f, 16),
                new Vector2(-25.5f, 16),
                new Vector2(-34.5f, 5),
                new Vector2(-34.5f, 0)
                );

            scoreTab = new PolyButton(Arranger.staticPoint(1 / 4f, 0f), scoreTabPoly, ContentStore.scoreTab, new Vector2(32.5f, 0), ScaleManager.CardScale, 0f);
            Arranger arranger = new Arranger(true, 1, 'L', 0);

            arranger.addObject(scoreboard, 0);
            arranger.performArrangements();
            trayPatch = ContentStore.scorePatch;
            patchPos  = Point.Zero;
            patchSize = Point.Zero;
        }
コード例 #10
0
        public GameClient()
        {
            DebugCards.init();

            frameController = new FrameController();

            frameTable      = new FrameTable(Vector2.Zero);
            frameHand       = new FrameHand(Vector2.Zero);
            frameBid        = new FrameBid(Vector2.Zero);
            frameScoreboard = new FrameScoreboard(Vector2.Zero);
            playerIndicator = new PlayerIndicator(Vector2.Zero);
            frameEndgame    = new FrameEndgame(Vector2.Zero);
            frameController.addFrame(frameHand, Arranger.staticPoint(0f, 1f), true);
            frameController.addFrame(frameTable, Arranger.staticPoint(0f, -1f), false);
            frameController.addFrame(frameBid, Arranger.staticPoint(1f, 0f), false);
            frameController.addFrame(frameScoreboard, Vector2.Zero, false);
            frameController.addFrame(playerIndicator, Arranger.staticPoint(-1f, 0f), false);
            frameController.addFrame(frameEndgame, Arranger.staticPoint(0f, 0f), false);

            parallax = new ParallaxBackground(Vector2.Zero);
            frameHand.injectParallax(parallax);

            playerHand = frameHand.hand;
        }
コード例 #11
0
ファイル: MessageQueue.cs プロジェクト: liangyee/Wizard
 public void Enqueue(string text)
 {
     continueOperation.WaitOne();
     activeMessages.Enqueue(new MessageBanner(Arranger.staticPoint(0.5f, 0.5f), text, 300f, 3000f, 300f, ScaleManager.InterfaceScale));
     continueOperation.Set();
 }