Inheritance: MonoBehaviour
Exemple #1
0
        Rectangle getBetButtonLocation(BetButton btn)
        {
            Rectangle location = Location;

            location.Height = location.Height - SystemInformation.CaptionHeight - SystemInformation.Border3DSize.Height;
            location.Width  = location.Width - SystemInformation.Border3DSize.Width * 2;
            location.Y      = Convert.ToInt32((double)location.Height - (double)location.Height * (double)0.064841498);

            switch (btn)
            {
            case BetButton.Left:
                location.X = Convert.ToInt32((double)location.Width - (double)location.Width * (double)0.411530815);
                break;

            case BetButton.Center:
                location.X = Convert.ToInt32((double)location.Width - (double)location.Width * (double)0.249502982);
                break;

            case BetButton.Right:
                location.X = Convert.ToInt32((double)location.Width - (double)location.Width * (double)0.095427435);
                break;
            }

            return(location);
        }
 void Start()
 {
     if (_instance == null)
     {
         _instance = this.gameObject.GetComponent <BetButton> ();
     }
     betView.text = betViewChild.text = (JurassicUIManager.instance.BetAmount * GameConnet.m_PMachineConfig.m_usBetMoney * GameConnet.m_PMachineConfig.m_byMaxLine).ToString();
 }
Exemple #3
0
    static void Main()
    {
        Clutter.Application.Init ();

        Stage = new Stage ();
        Stage.Title = "Deal!";
        Stage.Add (new Texture ("Pixmaps/Table.png"));
        Stage.SetSize (800, 480);
        Stage.KeyPressEvent += HandleKeyPress;

        Texture C = new Texture ("Pixmaps/Coin.png");
        C.SetSize (50, 50);
        C.SetPosition (35, 405);
        Stage.Add (C);

        Bet = 0;
        BetButton = new BetButton ();
        BetButton.ButtonPressEvent += IncreaseBet;
        Stage.Add (BetButton);

        DealButton = new DealButton ();
        DealButton.ButtonPressEvent += NewGame;
        Stage.Add (DealButton);

        StepButton = new StepButton ();
        StepButton.ButtonPressEvent += NextStep;
        Stage.Add (StepButton);

        Stack = new Stack ();
        Stack.Decrease (20);
        ScoreText = new Text ("Droid Sans Bold 21", "" + Stack.GetAmount());
        ScoreText.SetColor (new Clutter.Color (0xff, 0xff, 0xff, 0xff));
        ScoreText.SetPosition (100, 413);
        Stage.Add (ScoreText);

        Coins = new Coin [5];
        Coins [0] = new Coin ();
        Coins [1] = new Coin ();
        Coins [2] = new Coin ();
        Coins [3] = new Coin ();
        Coins [4] = new Coin ();
        for (int i = 0; i < 5; i++) {
            Coins [i].SetPosition (35, 405);
            Stage.Add (Coins [i]);
        }

        Deck = new Deck ();

        PlayerHand   = new Hand (Deck.Draw (), Deck.Draw (), Deck.Draw (), Deck.Draw (), Deck.Draw ());
        OpponentHand = new Hand (Deck.Draw (), Deck.Draw (), Deck.Draw (), Deck.Draw (), Deck.Draw ());

        SetupAnimation ();

        Stage.ShowAll();

        Clutter.Application.Run ();
    }
        Rectangle getBetButtonLocation(BetButton btn)
        {
            Rectangle location = Location;

            location.Height = location.Height - SystemInformation.CaptionHeight - SystemInformation.Border3DSize.Height;
            location.Width = location.Width - SystemInformation.Border3DSize.Width * 2;
            location.Y = Convert.ToInt32((double)location.Height - (double)location.Height * (double)0.064841498);

            switch (btn)
            {
                case BetButton.Left:
                    location.X = Convert.ToInt32((double)location.Width - (double)location.Width * (double)0.411530815);
                    break;
                case BetButton.Center:
                    location.X = Convert.ToInt32((double)location.Width - (double)location.Width * (double)0.249502982);
                    break;
                case BetButton.Right:
                    location.X = Convert.ToInt32((double)location.Width - (double)location.Width * (double)0.095427435);
                    break;
            }

            return location;
        }