Exemplo n.º 1
0
        public MonoGame(MainActivity mainActivity)
        {
            _mainActivity         = mainActivity;
            _graphics             = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            _screenManager = new ScreenManager(this, CommonVariables.BlockInLine);
            _screenManager.AddScreen(new BackgroundScreen());
            _screenManager.AddScreen(new MainMenuScreen());
            _screenManager.ShowAds          += ShowAdsEvent;
            _screenManager.CloseApplication += CloseApplicationEvent;
            _screenManager.OnGetScore        = delegate(string key) { return(SharedPreferences.GetStorageIntValue(CommonVariables.GameName, key)); };
            _screenManager.OnSetScore        = delegate(string key, int value) { SharedPreferences.SetStorageIntValue(CommonVariables.GameName, key, value); };

            Components.Add(_screenManager);

            _graphics.IsFullScreen = true;
            //graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
        }
Exemplo n.º 2
0
        public MonoGame(MainActivity mainActivity)
        {
            _mainActivity         = mainActivity;
            _graphics             = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            _screenManager = new ScreenManager(this, CommonVariables.BlockInLine);
            _screenManager.AddScreen(new BackgroundScreen());
            _screenManager.AddScreen(new MainMenuScreen());
            _screenManager.DisplayAdvertising        += (sender, e) => { CallInterstitial(); };
            _screenManager.CloseApplication          += (sender, e) => { Process.KillProcess(Process.MyPid()); };;
            _screenManager.SharePostInSocialMedia    += (sender, e) => { _mainActivity.FacebookAuthentication(); };
            _screenManager.ShareMessageInSocialMedia += (sender, e) => { _mainActivity.ShareMessageInSocialMedia(e.Subject, e.Message, e.SocialMedia); };
            _screenManager.OnGetScore = delegate(string key) { return(SharedPreferences.GetStorageDoubleValue(CommonVariables.GameName, key)); };
            _screenManager.OnSetScore = delegate(string key, double value) { SharedPreferences.SetStorageDoubleValue(CommonVariables.GameName, key, value); };

            Components.Add(_screenManager);

            _graphics.IsFullScreen = true;
            //graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
        }