Ejemplo n.º 1
0
        // Constructor
        public GamePage()
        {
            InitializeComponent();

            _game = XamlGame<CritterCampGame>.Create("", this);
            Storage.Set("scaleFactor", App.Current.Host.Content.ScaleFactor);

            //TryMediaPlay();
            //adDuplexAd.IsTest = true; // use this line to display our own ad for testing

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();

            offlineScreenCore = new OfflineScreenCore(this);
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.OfflineScreen);
            LoginView = FindViewById<View>(Resource.Id.LoginView);
            UserInput = FindViewById<View>(Resource.Id.UserInput);
            Status = FindViewById<TextView>(Resource.Id.Status);
            ResumeView = FindViewById<View>(Resource.Id.ResumeButton);

            Username = FindViewById<TextView>(Resource.Id.Username);
            Password = FindViewById<TextView>(Resource.Id.Password);

            Button Login = FindViewById<Button>(Resource.Id.Login);
            Login.Click += Login_Click;
            Button Register = FindViewById<Button>(Resource.Id.Register);
            Register.Click += Register_Click;
            ResumeView.Click += Play_Click;

            Game1.Activity = this;
            g = new Game1();
            AddContentView(g.Window, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FillParent, FrameLayout.LayoutParams.FillParent));
            g.Run();

            offlineScreenCore = new OfflineScreenCore(this);
        }