コード例 #1
0
ファイル: GamePlay1.cs プロジェクト: liangyee/Wizard
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        public void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            screenSize = new Point(graphics.GraphicsDevice.DisplayMode.Width, graphics.GraphicsDevice.DisplayMode.Height);
            DebugGUI.init(graphics.GraphicsDevice);
            ScaleManager.setDefaultValues(screenSize);
            Card.setDefaultScale(ScaleManager.CardScale);

            button = this.Content.Load <Texture2D>("button.9.png");

            Card.setTexture(this.Content.Load <Texture2D>("cards.png"));
            DebugCards.init();

            font11pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender11");
            font22pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender22");
            font33pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender33");
            font44pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender44");
            font55pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender55");

            frameController = new FrameController();

            frameHand = new FrameHand(Vector2.Zero);
            frameController.addFrame(frameHand, VectorDirection.Down, true);

            CardContainer container = frameHand.addContainer();

            for (int i = 0; i < 20; i++)
            {
                container.addCard(DebugCards.draw());
            }
            CardSnap snap = new CardSnap(new Vector2(0, screenSize.Y), (float)screenSize.X, false);

            frameHand.addSnap(container, snap);
        }
コード例 #2
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);
        }
コード例 #3
0
 public QuickCardTable(Vector2 position, Vector2 dimensions)
 {
     this.position   = position;
     this.dimensions = dimensions;
     snap            = new CardSnap(position - new Vector2((dimensions.X / 2f), 0), dimensions.X, true);
 }