Exemplo n.º 1
0
        public GameBase(Orientation orientation)
            : base()
        {
            _instance = this;

            GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);

            if (orientation == Orientation.Portrait)
            {
                graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.PortraitDown;
            }
            else
            {
                graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
            }

            graphics.IsFullScreen = true;

            Content.RootDirectory = "Content";

            GlobalTimerController.ClearInstance();
            TouchProcessor.ClearInstance();

            _scenes = new Dictionary<Type, Scene>();
            _currentScene = null;
            _tombstoneFileName = DefaultTombstoneFileName;
            _sceneTransitionCrossFadeTextureName = "";

            PurchaseManager = new External_APIS.iOS.InAppPurchaseManager();
        }
Exemplo n.º 2
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            NSError audioError;
            AVAudioSession.SharedInstance().SetCategory (new NSString("AVAudioSessionCategoryAmbient"), out audioError);

            app.SetStatusBarHidden (true, UIStatusBarAnimation.Slide);

            _monogameGame = GetInstance ();
            _monogameGame.Run ();

            return true;
        }
Exemplo n.º 3
0
        public GameBase(int screenWidth, int screenHeight, bool fullScreen)
            : base()
        {
            _instance = this;

            GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);
            graphics.PreferMultiSampling = true;
            graphics.IsFullScreen = fullScreen;
            graphics.PreferredBackBufferWidth = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;

            Content.RootDirectory = "Content";

            GlobalTimerController.ClearInstance();

            _scenes = new Dictionary<Type, Scene>();
            _currentScene = null;
            _tombstoneFileName = "";
        }
Exemplo n.º 4
0
        public GameBase(int screenWidth, int screenHeight, bool fullScreen)
            : base()
        {
            _instance = this;

            GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);

            graphics.PreferMultiSampling       = true;
            graphics.IsFullScreen              = fullScreen;
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;

            Content.RootDirectory = "Content";

            GlobalTimerController.ClearInstance();

            _scenes            = new Dictionary <Type, Scene>();
            _currentScene      = null;
            _tombstoneFileName = "";
        }
Exemplo n.º 5
0
        public static void Line(SpriteBatch spriteBatch, Texture2D texture, Vector2 origin, Vector2 target, float thickness, Color tint, float depth)
        {
            float   angle      = Utility.PointToPointAngle(origin, target);
            Vector2 renderLine = new Vector2(GameBase.ScreenScale(Vector2.Distance(origin, target)), Math.Max(GameBase.ScreenScale(thickness), 1.0f));

            spriteBatch.Draw(texture, GameBase.ScreenPosition(origin), null, tint, angle, new Vector2(0.0f, (thickness * texture.Height) / 2.0f), renderLine, SpriteEffects.None, depth);
        }