예제 #1
0
        public Ticker(Vector2 position, int scale)
        {
            this.position = position;
            this.scale    = scale;
            LinePoly upHitbox = new LinePoly(
                Vector2.Zero,
                new Vector2(-3, -10),
                new Vector2(3, -10),
                new Vector2(10, 3),
                new Vector2(10, 9),
                new Vector2(-10, 9),
                new Vector2(-10, 3)
                );

            upButton = new PolyButton(position + new Vector2(0, -19 * scale), upHitbox, ContentStore.tickerArrowUp, new Vector2(8, 8), scale, 0f);
            LinePoly downHitbox = new LinePoly(
                Vector2.Zero,
                new Vector2(-3, 10),
                new Vector2(3, 10),
                new Vector2(10, -3),
                new Vector2(10, -9),
                new Vector2(-10, -9),
                new Vector2(-10, -3)
                );

            downButton     = new PolyButton(position + new Vector2(0, 19 * scale), downHitbox, ContentStore.tickerArrowDown, new Vector2(8, 7), scale, 0f);
            displayTexture = new AnchoredTexture(ContentStore.tickerDisplay, Vector2.Zero, 0f, new Vector2(18, 10), scale);
            displayFont    = ScaleManager.LargeFont;
        }
예제 #2
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>();
        }
예제 #3
0
 public PolyButton(Vector2 position, LinePoly hitbox, Texture2D texture, Vector2 textureOrigin, float scale, float rotation, Action action = null)
 {
     this.hitbox = hitbox;
     resize(scale - 1);
     blink(position);
     rotate(rotation);
     this.texture       = texture;
     this.textureOrigin = textureOrigin;
     this.action        = action;
 }
예제 #4
0
        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();
        }
예제 #5
0
        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);
        }
예제 #6
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;
        }